From cc46058a8e822bb0207b58caef5d82a06621c4f8 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 3 Jul 2017 20:22:48 +0900 Subject: [PATCH] repmgrd: ensure standby_nodes list is up-to-date --- repmgrd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/repmgrd.c b/repmgrd.c index 6ab9e6da..38237d6b 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -620,6 +620,14 @@ monitor_streaming_standby(void) log_info("I am the candidate but did not get all votes; will now determine the best candidate"); + + /* 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, + &standby_nodes); + best_candidate = poll_best_candidate(&standby_nodes); /* this can occur in a tie-break situation, after we establish this node has priority*/ @@ -886,6 +894,8 @@ poll_best_candidate(NodeInfoList *standby_nodes) NodeInfoListCell *cell; t_node_info *best_candidate = &local_node_info; + // XXX ensure standby_nodes is set correctly + /* * we need to definitively decide the best candidate, as in some corner * cases we could end up with two candidate nodes, so they should each