From 061e72d7cd6166395e740f8d3a91376108846348 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 26 Jan 2015 20:12:34 +0900 Subject: [PATCH] Rename connection variable for clarity Connection will always be the primary --- repmgrd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/repmgrd.c b/repmgrd.c index 02831418..576cd8e9 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -1316,8 +1316,7 @@ do_primary_failover(void) /* local node not promotion candidate - find the new primary */ else { - // ZZZ upstream_conn -> new_primary_conn - PGconn *upstream_conn; + PGconn *new_primary_conn; /* wait */ sleep(10); @@ -1345,11 +1344,12 @@ do_primary_failover(void) /* and reconnect to the local database */ my_local_conn = establish_db_connection(local_options.conninfo, true); - upstream_conn = establish_db_connection(best_candidate.conninfo_str, true); - // reconnect to new primary + + + new_primary_conn = establish_db_connection(best_candidate.conninfo_str, true); /* update node information to reflect new status */ - update_node_record_set_upstream(upstream_conn, node_info.node_id, best_candidate.node_id); - PQfinish(upstream_conn); + update_node_record_set_upstream(new_primary_conn, node_info.node_id, best_candidate.node_id); + PQfinish(new_primary_conn); // ZZZ update node_info? }