From ebabc68f8aa3ffa6d71980677d89b721f89369c6 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 19 Mar 2015 22:15:45 +0900 Subject: [PATCH] Add recovery.conf file location and contents to debugging output --- repmgr.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/repmgr.c b/repmgr.c index c341a2d5..e820315e 100644 --- a/repmgr.c +++ b/repmgr.c @@ -2301,22 +2301,32 @@ create_recovery_file(const char *data_dir) return false; } + log_debug(_("create_recovery_file(): creating '%s'...\n"), recovery_file_path); + /* standby_mode = 'on' */ maxlen_snprintf(line, "standby_mode = 'on'\n"); if(write_recovery_file_line(recovery_file, recovery_file_path, line) == false) return false; + log_debug(_("recovery.conf: %s"), line); + /* primary_conninfo = '...' */ write_primary_conninfo(line); + if(write_recovery_file_line(recovery_file, recovery_file_path, line) == false) return false; + log_debug(_("recovery.conf: %s"), line); + /* recovery_target_timeline = 'latest' */ maxlen_snprintf(line, "recovery_target_timeline = 'latest'\n"); + if(write_recovery_file_line(recovery_file, recovery_file_path, line) == false) return false; + log_debug(_("recovery.conf: %s"), line); + /* min_recovery_apply_delay = ... (optional) */ if(*runtime_options.min_recovery_apply_delay) { @@ -2324,6 +2334,8 @@ create_recovery_file(const char *data_dir) runtime_options.min_recovery_apply_delay); if(write_recovery_file_line(recovery_file, recovery_file_path, line) == false) return false; + + log_debug(_("recovery.conf: %s"), line); } /* primary_slot_name = '...' (optional, for 9.4 and later) */ @@ -2333,6 +2345,8 @@ create_recovery_file(const char *data_dir) repmgr_slot_name); if(write_recovery_file_line(recovery_file, recovery_file_path, line) == false) return false; + + log_debug(_("recovery.conf: %s"), line); } fclose(recovery_file); @@ -2924,7 +2938,6 @@ write_primary_conninfo(char *line) appname_buf); maxlen_snprintf(line, "primary_conninfo = '%s'\n", conn_buf); - }