Don't close connection to master until upstream node updated

This commit is contained in:
Ian Barwick
2015-09-23 12:27:37 +09:00
parent ef6b24551a
commit 640abed18f
2 changed files with 4 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
Bugfix: ignore comments after values (soxwellfb) Bugfix: ignore comments after values (soxwellfb)
Bugfix: handle string values in 'node' parameter correctly(Gregory Duchatelet) Bugfix: handle string values in 'node' parameter correctly(Gregory Duchatelet)
Allow repmgr to be compiled with a newer libpq (Marco) Allow repmgr to be compiled with a newer libpq (Marco)
Bugfix: call update_node_record_set_upstream() for STANDBY FOLLOW (Tomas)
3.0.1 2015-04-16 3.0.1 2015-04-16
Prevent repmgrd from looping infinitely if node was not registered (Ian) Prevent repmgrd from looping infinitely if node was not registered (Ian)

View File

@@ -1765,7 +1765,6 @@ do_standby_follow(void)
strncpy(runtime_options.host, PQhost(master_conn), MAXLEN); strncpy(runtime_options.host, PQhost(master_conn), MAXLEN);
strncpy(runtime_options.masterport, PQport(master_conn), MAXLEN); strncpy(runtime_options.masterport, PQport(master_conn), MAXLEN);
strncpy(runtime_options.username, PQuser(master_conn), MAXLEN); strncpy(runtime_options.username, PQuser(master_conn), MAXLEN);
PQfinish(master_conn);
log_info(_("changing standby's master\n")); log_info(_("changing standby's master\n"));
@@ -1801,8 +1800,11 @@ do_standby_follow(void)
options.node, master_id) == false) options.node, master_id) == false)
{ {
log_err(_("unable to update upstream node")); log_err(_("unable to update upstream node"));
PQfinish(master_conn);
exit(ERR_BAD_CONFIG); exit(ERR_BAD_CONFIG);
} }
PQfinish(master_conn);
return; return;
} }