mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
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:
@@ -1539,8 +1539,15 @@ loop:
|
|||||||
static bool
|
static bool
|
||||||
do_primary_failover(void)
|
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 */
|
/* attempt to initiate voting process */
|
||||||
ElectionResult election_result = do_election();
|
election_result = do_election();
|
||||||
|
|
||||||
/* TODO add pre-event notification here */
|
/* TODO add pre-event notification here */
|
||||||
failover_state = FAILOVER_STATE_UNKNOWN;
|
failover_state = FAILOVER_STATE_UNKNOWN;
|
||||||
|
|||||||
Reference in New Issue
Block a user