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.
This commit is contained in:
Ian Barwick
2020-10-05 16:50:41 +09:00
parent 5b254a1be9
commit 42283bf344

View File

@@ -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);