From 3b66a31ac9a65b8983618677b6a56f2eaedd9e9a Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Fri, 26 Jul 2013 00:52:31 -0500 Subject: [PATCH] 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. --- repmgrd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repmgrd.c b/repmgrd.c index a15cbef2..a68532f9 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -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);