From 526803c5e0a93091352d9c3bea50b6ed5ee5ccf1 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 12 Jan 2015 13:32:04 +0900 Subject: [PATCH] Witness server should always try to re-connect to primary Standbys will try to reconnect even in MANUAL_FAILOVER mode, so it's consistent to have the witness server do that too. --- repmgrd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/repmgrd.c b/repmgrd.c index 2cf2af6f..7f168783 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -473,8 +473,12 @@ main(int argc, char **argv) return 0; } + /* + * witness_monitor() * + * Monitors witness server; attempt to find and connect to new primary + * if existing primary connection is lost */ static void witness_monitor(void) @@ -485,15 +489,15 @@ witness_monitor(void) bool connection_ok; /* - * Check if master is available; - * if not, assume failover situation and try to determie new master - * ZZZ only if `AUTOMATIC_FAILOVER` set??? + * Check if master is available; if not, assume failover situation + * and try to determine new master. There may be a delay between detection + * of a missing master and promotion of a standby by that standby's + * rempgrd, so we'll loop for a while before giving up. */ connection_ok = check_connection(primary_conn, "master"); if(connection_ok == FALSE) { - log_debug(_("Old primary node ID: %i\n"), primary_options.node); /* We need to wait a while for the new primary to be promoted */ // ZZZ loop here `local_options.reconnect_attempts` times