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:
Jaime Casanova
2013-07-26 00:52:31 -05:00
parent ad3630e7a9
commit 3b66a31ac9

View File

@@ -625,7 +625,7 @@ do_failover(void)
" FROM %s.repl_nodes "
" WHERE id <> %d "
" AND cluster = '%s' "
" ORDER BY priority ",
" ORDER BY priority, id ",
repmgr_schema, primary_options.node, local_options.cluster_name);
res1 = PQexec(myLocalConn, sqlquery);