repmgrd: add additional local node connection check

It's possible there are corner-cases where do_election() is called while the
local connection is invalid, so perform an additional check.
This commit is contained in:
Ian Barwick
2018-07-11 15:11:20 +09:00
parent c6b8d78bad
commit 17f30ec364

View File

@@ -1539,8 +1539,15 @@ loop:
static bool
do_primary_failover(void)
{
ElectionResult election_result;
/*
* Double-check status of the local connection
*/
check_connection(&local_node_info, &local_conn);
/* attempt to initiate voting process */
ElectionResult election_result = do_election();
election_result = do_election();
/* TODO add pre-event notification here */
failover_state = FAILOVER_STATE_UNKNOWN;