From 640abed18fd21cee4a998238fad6980393b09a73 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Wed, 23 Sep 2015 12:27:37 +0900 Subject: [PATCH] Don't close connection to master until upstream node updated --- HISTORY | 1 + repmgr.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index 6d8697e3..cf4cfb90 100644 --- a/HISTORY +++ b/HISTORY @@ -7,6 +7,7 @@ Bugfix: ignore comments after values (soxwellfb) Bugfix: handle string values in 'node' parameter correctly(Gregory Duchatelet) 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 Prevent repmgrd from looping infinitely if node was not registered (Ian) diff --git a/repmgr.c b/repmgr.c index 284bb58a..722519b9 100644 --- a/repmgr.c +++ b/repmgr.c @@ -1765,7 +1765,6 @@ do_standby_follow(void) strncpy(runtime_options.host, PQhost(master_conn), MAXLEN); strncpy(runtime_options.masterport, PQport(master_conn), MAXLEN); strncpy(runtime_options.username, PQuser(master_conn), MAXLEN); - PQfinish(master_conn); log_info(_("changing standby's master\n")); @@ -1801,8 +1800,11 @@ do_standby_follow(void) options.node, master_id) == false) { log_err(_("unable to update upstream node")); + PQfinish(master_conn); + exit(ERR_BAD_CONFIG); } + PQfinish(master_conn); return; }