From 9ceef937ebea72747a68569c1508ac62788b36e1 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 5 Feb 2015 11:17:23 +0900 Subject: [PATCH] Emit warning if -w/--wal-keep-segments used when `use_replication_slots` set --- repmgr.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/repmgr.c b/repmgr.c index 9a405bdd..cd47608a 100644 --- a/repmgr.c +++ b/repmgr.c @@ -363,6 +363,7 @@ main(int argc, char **argv) exit(ERR_BAD_CONFIG); } } + /* * If no configuration file was provided, set to a default file * which `parse_config()` will attempt to read if it exists @@ -440,6 +441,19 @@ main(int argc, char **argv) } } + + /* + * If `use_replication_slots` set in the configuration file + * and command line parameter `--wal-keep-segments` was used, + * emit a warning as to the latter's redundancy. Note that + * the version check for 9.4 or later will occur afterwards. + */ + + if(options.use_replication_slots && strlen(runtime_options.wal_keep_segments)) + { + log_warning(_("-w/--wal-keep-segments has no effect when replication slots in use\n")); + } + /* Initialise the repmgr schema name */ maxlen_snprintf(repmgr_schema, "%s%s", DEFAULT_REPMGR_SCHEMA_PREFIX, options.cluster_name);