Enable provision of "archive_cleanup_command" in recovery.conf

If "archive_cleanup_command" is defined in "repmgr.conf", a corresponding
entry will be made in the node's "recovery.conf" file after cloning a
standby.

Note that we recommend using PgBarman to manage WAL archives, but are
providing this facility to help repmgr to be integrated in existing environments.

Implements GitHub #416.
This commit is contained in:
Ian Barwick
2018-04-03 14:06:13 +09:00
parent 23c99304a6
commit 0d73d3c2b5
6 changed files with 97 additions and 10 deletions

View File

@@ -5864,7 +5864,6 @@ create_recovery_file(t_node_info *node_record, t_conninfo_param_list *recovery_c
appendPQExpBuffer(&recovery_file_buf,
"recovery_min_apply_delay = %s\n",
config_file_options.recovery_min_apply_delay);
}
/* primary_slot_name = '...' (optional, for 9.4 and later) */
@@ -5889,6 +5888,16 @@ create_recovery_file(t_node_info *node_record, t_conninfo_param_list *recovery_c
free(escaped);
}
/* archive_cleanup_command (optional) */
if (config_file_options.archive_cleanup_command[0] != '\0')
{
char *escaped = escape_recovery_conf_value(config_file_options.archive_cleanup_command);
appendPQExpBuffer(&recovery_file_buf,
"archive_cleanup_command = '%s'\n",
escaped);
free(escaped);
}
if (as_file == true)
{
maxpath_snprintf(recovery_file_path, "%s/%s", dest, RECOVERY_COMMAND_FILE);