diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index b8ae1296..efe79683 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -87,10 +87,22 @@ static CheckStatus parse_node_check_archiver(const char *node_check_output, int static CheckStatus parse_node_check_replication_lag(const char *node_check_output, int *seconds, int *threshold); /* - * do_standby_clone() + * STANDBY CLONE * * Event(s): * - standby_clone + * + * Parameters: + * --upstream-conninfo + * --no-upstream-connection + * -F/--force + * --dry-run + * -c/--fast-checkpoint + * --copy-external-config-files + * --recovery-min-apply-delay + * --replication-user XXX only required if no upstream record + * --use-recovery-conninfo-password + * --without-barman */ void diff --git a/repmgr-client-global.h b/repmgr-client-global.h index 43d39ee1..e2604c56 100644 --- a/repmgr-client-global.h +++ b/repmgr-client-global.h @@ -22,7 +22,6 @@ typedef struct bool connection_param_provided; bool host_param_provided; bool limit_provided; - bool wal_keep_segments_used; /* general configuration options */ char config_file[MAXPGPATH]; @@ -68,7 +67,6 @@ typedef struct char upstream_conninfo[MAXLEN]; int upstream_node_id; bool use_recovery_conninfo_password; - char wal_keep_segments[MAXLEN]; bool without_barman; /* "standby register" options */ @@ -111,7 +109,7 @@ typedef struct #define T_RUNTIME_OPTIONS_INITIALIZER { \ /* configuration metadata */ \ - false, false, false, false, false, \ + false, false, false, false, \ /* general configuration options */ \ "", false, false, "", false, \ /* logging options */ \ @@ -126,7 +124,7 @@ typedef struct UNKNOWN_NODE_ID, "", "", \ /* "standby clone" options */ \ false, CONFIG_FILE_SAMEPATH, false, false, false, "", "", "", \ - NO_UPSTREAM_NODE, false, "", false, \ + NO_UPSTREAM_NODE, false, false, \ /* "standby register" options */ \ false, 0, \ /* "standby switchover" options */ \ diff --git a/repmgr-client.c b/repmgr-client.c index 59b665d7..4dfa2357 100644 --- a/repmgr-client.c +++ b/repmgr-client.c @@ -334,15 +334,6 @@ main(int argc, char **argv) } break; - /* -w/--wal-keep-segments */ - case 'w': - (void) 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; @@ -2160,23 +2151,13 @@ check_upstream_config(PGconn *conn, int server_version_num, bool exit_on_error) else if (mode != barman) { bool check_wal_keep_segments = false; - char min_wal_keep_segments[MAXLEN] = "1"; - - /* - * -w/--wal-keep-segments was supplied - check against that value - */ - if (runtime_options.wal_keep_segments_used == true) - { - check_wal_keep_segments = true; - strncpy(min_wal_keep_segments, runtime_options.wal_keep_segments, MAXLEN); - } /* * A non-zero `wal_keep_segments` value will almost certainly be required * if pg_basebackup is being used with --xlog-method=fetch, * *and* no restore command has been specified */ - else if (xlog_stream == false + if (xlog_stream == false && strcmp(config_file_options.restore_command, "") == 0) { check_wal_keep_segments = true; @@ -2184,14 +2165,13 @@ check_upstream_config(PGconn *conn, int server_version_num, bool exit_on_error) if (check_wal_keep_segments == true) { - i = guc_set_typed(conn, "wal_keep_segments", ">=", min_wal_keep_segments, "integer"); + i = guc_set_typed(conn, "wal_keep_segments", ">", "0", "integer"); if (i == 0 || i == -1) { if (i == 0) { - log_error(_("parameter \"wal_keep_segments\" on the upstream server must be be set to %s or greater"), - min_wal_keep_segments); + log_error(_("parameter \"wal_keep_segments\" on the upstream server must be be set to a non-zero value")); log_hint(_("Choose a value sufficiently high enough to retain enough WAL " "until the standby has been cloned and started.\n " "Alternatively set up WAL archiving using e.g. PgBarman and configure " diff --git a/repmgr-client.h b/repmgr-client.h index f6928e39..cc61bef4 100644 --- a/repmgr-client.h +++ b/repmgr-client.h @@ -118,7 +118,6 @@ static struct option long_options[] = /* "standby clone" options */ {"copy-external-config-files", optional_argument, NULL, OPT_COPY_EXTERNAL_CONFIG_FILES}, {"fast-checkpoint", no_argument, NULL, 'c'}, - {"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},