mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
call update_node_record_set_upstream() for STANDBY FOLLOW
repmgrd correctly updates ID of the upstream node after automatic failover, but repmgr was not doing that for manual failvers. This moves the existing function to dbutils and modifies it so that it does not rely on global variables with configuration (available just in repmgrd). This should fix issue #67 (hopefully, haven't done much testing).
This commit is contained in:
committed by
Ian Barwick
parent
42847e44d2
commit
ef6b24551a
10
repmgr.c
10
repmgr.c
@@ -1689,6 +1689,7 @@ do_standby_follow(void)
|
||||
char script[MAXLEN];
|
||||
char master_conninfo[MAXLEN];
|
||||
PGconn *master_conn;
|
||||
int master_id;
|
||||
|
||||
int r,
|
||||
retval;
|
||||
@@ -1727,7 +1728,7 @@ do_standby_follow(void)
|
||||
}
|
||||
|
||||
master_conn = get_master_connection(conn,
|
||||
options.cluster_name, NULL, (char *) &master_conninfo);
|
||||
options.cluster_name, &master_id, (char *) &master_conninfo);
|
||||
}
|
||||
while (master_conn == NULL && runtime_options.wait_for_master);
|
||||
|
||||
@@ -1796,6 +1797,13 @@ do_standby_follow(void)
|
||||
exit(ERR_NO_RESTART);
|
||||
}
|
||||
|
||||
if(update_node_record_set_upstream(master_conn, options.cluster_name,
|
||||
options.node, master_id) == false)
|
||||
{
|
||||
log_err(_("unable to update upstream node"));
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user