From 81b8a944de49d37c8f331656a9d65355265265e3 Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Wed, 19 Dec 2012 11:45:58 -0500 Subject: [PATCH] Fix a problem that caused a standby to promote itself without going to voting procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is because of a race condition inside CheckPrimaryConnection(). This has independently reported by Alex Railean and Dumitru, and Frank Jördens. Analyzed and fixed by Cédric Villemain. The fix have been verified to work by Frank --- repmgrd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repmgrd.c b/repmgrd.c index b444df4e..84283fa9 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -792,7 +792,7 @@ CheckPrimaryConnection(void) { log_info(_("%s: Connection to master has been restored.\n"), progname); } - break; + return true; } } if (!is_pgup(primaryConn, local_options.master_response_timeout))