mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
Rename connection variable for clarity
Connection will always be the primary
This commit is contained in:
12
repmgrd.c
12
repmgrd.c
@@ -1316,8 +1316,7 @@ do_primary_failover(void)
|
|||||||
/* local node not promotion candidate - find the new primary */
|
/* local node not promotion candidate - find the new primary */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ZZZ upstream_conn -> new_primary_conn
|
PGconn *new_primary_conn;
|
||||||
PGconn *upstream_conn;
|
|
||||||
/* wait */
|
/* wait */
|
||||||
sleep(10);
|
sleep(10);
|
||||||
|
|
||||||
@@ -1345,11 +1344,12 @@ do_primary_failover(void)
|
|||||||
|
|
||||||
/* and reconnect to the local database */
|
/* and reconnect to the local database */
|
||||||
my_local_conn = establish_db_connection(local_options.conninfo, true);
|
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 information to reflect new status */
|
||||||
update_node_record_set_upstream(upstream_conn, node_info.node_id, best_candidate.node_id);
|
update_node_record_set_upstream(new_primary_conn, node_info.node_id, best_candidate.node_id);
|
||||||
PQfinish(upstream_conn);
|
PQfinish(new_primary_conn);
|
||||||
|
|
||||||
// ZZZ update node_info?
|
// ZZZ update node_info?
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user