mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
repmgrd: consolidate clear_node_info_list() calls
This commit is contained in:
@@ -1430,6 +1430,8 @@ get_active_sibling_node_records(PGconn *conn, int node_id, int upstream_node_id,
|
|||||||
PQExpBufferData query;
|
PQExpBufferData query;
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
|
|
||||||
|
clear_node_info_list(node_list);
|
||||||
|
|
||||||
initPQExpBuffer(&query);
|
initPQExpBuffer(&query);
|
||||||
|
|
||||||
appendPQExpBuffer(&query,
|
appendPQExpBuffer(&query,
|
||||||
|
|||||||
@@ -934,8 +934,11 @@ monitor_streaming_standby(void)
|
|||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// unable to connect to former primary - check if another node has
|
// unable to connect to former primary - check if another node has
|
||||||
// been promoted
|
// been promoted
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1031,7 +1034,6 @@ do_primary_failover(void)
|
|||||||
|
|
||||||
|
|
||||||
/* reset node list */
|
/* reset node list */
|
||||||
clear_node_info_list(&standby_nodes);
|
|
||||||
get_active_sibling_node_records(local_conn,
|
get_active_sibling_node_records(local_conn,
|
||||||
local_node_info.node_id,
|
local_node_info.node_id,
|
||||||
upstream_node_info.node_id,
|
upstream_node_info.node_id,
|
||||||
@@ -1107,8 +1109,6 @@ do_primary_failover(void)
|
|||||||
|
|
||||||
failover_state = promote_self();
|
failover_state = promote_self();
|
||||||
|
|
||||||
/* reset node list */
|
|
||||||
clear_node_info_list(&standby_nodes);
|
|
||||||
get_active_sibling_node_records(local_conn,
|
get_active_sibling_node_records(local_conn,
|
||||||
local_node_info.node_id,
|
local_node_info.node_id,
|
||||||
upstream_node_info.node_id,
|
upstream_node_info.node_id,
|
||||||
@@ -1838,8 +1838,6 @@ do_election(void)
|
|||||||
/* get all active nodes attached to primary, excluding self */
|
/* get all active nodes attached to primary, excluding self */
|
||||||
// XXX include barman node in results
|
// XXX include barman node in results
|
||||||
|
|
||||||
clear_node_info_list(&standby_nodes);
|
|
||||||
|
|
||||||
get_active_sibling_node_records(local_conn,
|
get_active_sibling_node_records(local_conn,
|
||||||
local_node_info.node_id,
|
local_node_info.node_id,
|
||||||
upstream_node_info.node_id,
|
upstream_node_info.node_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user