Improve repmgr configuration file handling

Previous behaviour was somewhat counterintuitive, with an error
message being logged if no configuration file provided or found,
even though this is not actually an error.

Configuration files now handled like this:

- if a configuration file is explicitly provided (-f), error out
  if not found.

- if no configuration file explicitly provided, attempt to open
  default configuration file; if this does not exist, log
  notice and continue with default values.

Also, for 9.4 and later add a hint about replication slot usage
if 'use_replication_slots' not set.
This commit is contained in:
Ian Barwick
2015-02-04 09:57:51 +09:00
parent 49debcdf92
commit 3d9d0d98af
2 changed files with 45 additions and 22 deletions

View File

@@ -65,8 +65,9 @@ parse_config(const char *config_file, t_configuration_options * options)
*/
if (fp == NULL)
{
log_err(_("Did not find the configuration file '%s', continuing\n"),
config_file);
log_notice(_("No configuration file provided and default file '%s' not found - "
"continuing with default values\n"),
config_file);
return;
}