From 42283bf344300e9aae579d7a8751907659686112 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 5 Oct 2020 16:50:41 +0900 Subject: [PATCH] repmgrd: check local connection after promoting local node In theory the local connection should not be affected by the node's promotion. However we're handing over control to an external command which is usually just "repmgr standby promote", but could potentially be a user-defined script with unknowable side effects. So it's better to be safe than sorry. --- repmgrd-physical.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repmgrd-physical.c b/repmgrd-physical.c index 8e2910c7..8b5ca337 100644 --- a/repmgrd-physical.c +++ b/repmgrd-physical.c @@ -3663,6 +3663,11 @@ promote_self(void) return FAILOVER_STATE_PROMOTION_FAILED; } + /* + * Promotion has succeeded - verify local connection is still available + */ + try_reconnect(&local_conn, &local_node_info); + /* bump the electoral term */ increment_current_term(local_conn);