mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 00:46:29 +00:00
In a failover situation get the nodes in a well defined order.
When deciding which node will be the new master, we should get the nodes in a well defined order otherwise two standbys could process nodes with the same priority in different order and end up with a two master situation.
This commit is contained in:
@@ -625,7 +625,7 @@ do_failover(void)
|
|||||||
" FROM %s.repl_nodes "
|
" FROM %s.repl_nodes "
|
||||||
" WHERE id <> %d "
|
" WHERE id <> %d "
|
||||||
" AND cluster = '%s' "
|
" AND cluster = '%s' "
|
||||||
" ORDER BY priority ",
|
" ORDER BY priority, id ",
|
||||||
repmgr_schema, primary_options.node, local_options.cluster_name);
|
repmgr_schema, primary_options.node, local_options.cluster_name);
|
||||||
|
|
||||||
res1 = PQexec(myLocalConn, sqlquery);
|
res1 = PQexec(myLocalConn, sqlquery);
|
||||||
|
|||||||
Reference in New Issue
Block a user