From df34e7e8c5b17f63c06008458d3a251e51ab84a2 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Fri, 22 Feb 2019 15:49:02 +0900 Subject: [PATCH] Prevent "invalid LSN ..." infinite loop when node is passive --- repmgrd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repmgrd.c b/repmgrd.c index f9cdc496..6b3f24b6 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -523,6 +523,11 @@ main(int argc, char **argv) * NOTE: this is a temporary workaround for a structural * issue resolved through architectural redesign in repmgr 4. */ + if (local_options.failover == MANUAL_FAILOVER) + { + update_shared_memory(PASSIVE_NODE); + } + else { PQExpBufferData current_lsn; @@ -1664,7 +1669,7 @@ do_master_failover(void) if (strcmp(location_value, PASSIVE_NODE) == 0) { log_info(_("node %i will not be considered for promotion\n"), nodes[i].node_id); - log_detail("node %i indicates it is a passive mode\n", nodes[i].node_id); + log_detail("node %i indicates it is a passive node\n", nodes[i].node_id); nodes[i].xlog_location = InvalidXLogRecPtr; continue_loop = false; }