From 5bf70981399ba6d8abf61515571c963c567cce97 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Sun, 9 Jul 2017 11:10:49 +0900 Subject: [PATCH] repmgrd: consolidate clear_node_info_list() calls --- dbutils.c | 2 ++ repmgrd.c | 12 +++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dbutils.c b/dbutils.c index c8c2b77a..3b183434 100644 --- a/dbutils.c +++ b/dbutils.c @@ -1430,6 +1430,8 @@ get_active_sibling_node_records(PGconn *conn, int node_id, int upstream_node_id, PQExpBufferData query; PGresult *res; + clear_node_info_list(node_list); + initPQExpBuffer(&query); appendPQExpBuffer(&query, diff --git a/repmgrd.c b/repmgrd.c index c8103059..297ab1f3 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -934,8 +934,11 @@ monitor_streaming_standby(void) goto loop; } } - // unable to connect to former primary - check if another node has - // been promoted + else + { + // unable to connect to former primary - check if another node has + // been promoted + } } @@ -1031,7 +1034,6 @@ do_primary_failover(void) /* reset node list */ - clear_node_info_list(&standby_nodes); get_active_sibling_node_records(local_conn, local_node_info.node_id, upstream_node_info.node_id, @@ -1107,8 +1109,6 @@ do_primary_failover(void) failover_state = promote_self(); - /* reset node list */ - clear_node_info_list(&standby_nodes); get_active_sibling_node_records(local_conn, local_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 */ // XXX include barman node in results - clear_node_info_list(&standby_nodes); - get_active_sibling_node_records(local_conn, local_node_info.node_id, upstream_node_info.node_id,