All Products
Search
Document Center

PolarDB:Automatic and manual primary/secondary switchover

Last Updated:Jan 27, 2026

If a system failure occurs, a PolarDB cluster automatically performs a failover. You can also perform a manual switchover to designate a read-only node as the new primary node.

Scope

PolarDB for PostgreSQL Distributed Edition clusters do not support automatic or manual primary/secondary switchovers.

Considerations

Both automatic and manual switchovers can cause a transient disconnection of about 30 seconds. Before you perform a switchover, ensure that your application has a reconnection mechanism.

Automatic primary/secondary switchover

PolarDB uses an active-active high availability architecture. If a system failure occurs, the system automatically performs a failover to elect a new primary node from the read-only nodes.

Each node in the cluster has a failover priority, which determines its probability of being elected as the primary node during a failover. If multiple nodes have the same priority, they have an equal probability of being elected.

The system automatically selects a new primary node as follows:

  1. The system identifies all eligible read-only nodes.

  2. The system selects one or more read-only nodes with the highest priority.

  3. If the switchover to the first selected node fails for reasons such as network issues or an abnormal replication state, the system attempts to switch to the next node until the operation succeeds.

Manual primary/secondary switchover

  1. Log on to the PolarDB console. In the navigation pane on the left, click Clusters. Select the region of the cluster and then click the cluster ID.

  2. On the Basic Information page, in the Database Nodes section, click the 切换 icon in the upper-right corner to switch the view.

  3. Click Fail Over.

  4. In the dialog box that appears, select the destination node from the New Primary Node list and click OK.

Related API operations

API

Description

FailoverDBCluster

Performs a manual primary/secondary switchover for a PolarDB cluster. You can specify a read-only node as the new primary node.