From 028aeb452d334f76115426255f1e66ea57888aa9 Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Sat, 23 Oct 2010 19:44:07 -0500 Subject: [PATCH] Fix STANDBY FOLLOW to correctly recreate recovery.conf --- repmgr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/repmgr.c b/repmgr.c index 4e1cb483..0f25d163 100644 --- a/repmgr.c +++ b/repmgr.c @@ -1114,6 +1114,13 @@ do_standby_follow(void) return; } + /* + * set the host and masterport variables with the master ones + * before closing the connection because we will need them to + * recreate the recovery.conf file + */ + host = PQhost(master_conn); + masterport = PQport(master_conn); PQfinish(master_conn); if (verbose) @@ -1134,7 +1141,7 @@ do_standby_follow(void) PQclear(res); PQfinish(conn); - /* Finally, write the recovery.conf file */ + /* write the recovery.conf file */ if (!create_recovery_file(data_dir)) return;