Emit warning if -w/--wal-keep-segments used when use_replication_slots set

This commit is contained in:
Ian Barwick
2015-02-05 11:17:23 +09:00
parent f047ec9526
commit 9ceef937eb

View File

@@ -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);