From 23ef305afbb9c0d133ebe4e34329a994eda4ca90 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 27 Jan 2015 16:25:58 +0900 Subject: [PATCH] After promotion or follow, update internal node metadata record --- repmgrd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/repmgrd.c b/repmgrd.c index 32b9f0a6..b1af31dd 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -1290,6 +1290,9 @@ do_primary_failover(void) /* update node information to reflect new status */ update_node_record_set_primary(my_local_conn, node_info.node_id, failed_primary.node_id); + + /* update internal record for this node*/ + node_info = get_node_info(my_local_conn, local_options.cluster_name, local_options.node); } /* local node not promotion candidate - find the new primary */ else @@ -1327,6 +1330,10 @@ do_primary_failover(void) /* update node information to reflect new status */ update_node_record_set_upstream(new_primary_conn, node_info.node_id, best_candidate.node_id); + + /* update internal record for this node*/ + node_info = get_node_info(new_primary_conn, local_options.cluster_name, local_options.node); + PQfinish(new_primary_conn); }