"standby clone": process -w/--wal-keep-segment

This commit is contained in:
Ian Barwick
2017-05-05 21:03:16 +09:00
parent aaa9af2371
commit 5e48a19ebe
3 changed files with 16 additions and 3 deletions

View File

@@ -216,6 +216,10 @@ do_standby_clone(void)
* the upstream is not available, so no point in checking for it.
*
* XXX not sure of the logic here (and yes I did think this up)
* - we'll need the source connection in any case, just won't connect
* to the "upstream_conninfo" server. We'd probably need to
* to override "no_upstream_connection" if connection params
* actually provided.
*/
if (*runtime_options.upstream_conninfo)

View File

@@ -297,6 +297,15 @@ main(int argc, char **argv)
runtime_options.rsync_only = true;
break;
/* -w/--wal-keep-segments */
case 'w':
repmgr_atoi(optarg, "-w/--wal-keep-segments", &cli_errors, false);
strncpy(runtime_options.wal_keep_segments,
optarg,
MAXLEN);
runtime_options.wal_keep_segments_used = true;
break;
/* --no-upstream-connection */
case OPT_NO_UPSTREAM_CONNECTION:
runtime_options.no_upstream_connection = true;
@@ -310,7 +319,7 @@ main(int argc, char **argv)
if (targ < 1)
{
item_list_append(&cli_errors, _("Invalid value provided for '--recovery-min-apply-delay'"));
item_list_append(&cli_errors, _("invalid value provided for '--recovery-min-apply-delay'"));
break;
}
if (ptr && *ptr)
@@ -320,7 +329,7 @@ main(int argc, char **argv)
strcmp(ptr, "d") != 0)
{
item_list_append(&cli_errors,
_("Value provided for '--recovery-min-apply-delay' must be one of ms/s/min/h/d"));
_("value provided for '--recovery-min-apply-delay' must be one of ms/s/min/h/d"));
break;
}
}

View File

@@ -96,6 +96,7 @@ static struct option long_options[] =
{"copy-external-config-files", optional_argument, NULL, OPT_COPY_EXTERNAL_CONFIG_FILES},
{"fast-checkpoint", no_argument, NULL, 'c'},
{"rsync-only", no_argument, NULL, 'r'},
{"wal-keep-segments", required_argument, NULL, 'w'},
{"no-upstream-connection", no_argument, NULL, OPT_NO_UPSTREAM_CONNECTION},
{"recovery-min-apply-delay", required_argument, NULL, OPT_RECOVERY_MIN_APPLY_DELAY},
{"replication-user", required_argument, NULL, OPT_REPLICATION_USER},
@@ -115,7 +116,6 @@ static struct option long_options[] =
{"no-conninfo-password", no_argument, NULL, OPT_NO_CONNINFO_PASSWORD},
/* not yet handled */
{"wal-keep-segments", required_argument, NULL, 'w'},
{"keep-history", required_argument, NULL, 'k'},
{"wait", no_argument, NULL, 'W'},
{"rsync-only", no_argument, NULL, 'r'},