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:
The system identifies all eligible read-only nodes.
The system selects one or more read-only nodes with the highest priority.
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
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.
On the Basic Information page, in the Database Nodes section, click the
icon in the upper-right corner to switch the view.Click Fail Over.
In the dialog box that appears, select the destination node from the New Primary Node list and click OK.
Related API operations
API | Description |
Performs a manual primary/secondary switchover for a PolarDB cluster. You can specify a read-only node as the new primary node. |