mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Add checks for use of --upstream-node-id
This commit is contained in:
@@ -281,6 +281,14 @@ main(int argc, char **argv)
|
||||
strncpy(runtime_options.node_name, optarg, MAXLEN);
|
||||
break;
|
||||
|
||||
/* standby options *
|
||||
* --------------- */
|
||||
|
||||
/* --upstream-node-id */
|
||||
case OPT_UPSTREAM_NODE_ID:
|
||||
runtime_options.upstream_node_id = repmgr_atoi(optarg, "--upstream-node-id", &cli_errors, false);
|
||||
break;
|
||||
|
||||
/* standby clone options *
|
||||
* --------------------- */
|
||||
|
||||
@@ -311,7 +319,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* -w/--wal-keep-segments */
|
||||
case 'w':
|
||||
repmgr_atoi(optarg, "-w/--wal-keep-segments", &cli_errors, false);
|
||||
(void) repmgr_atoi(optarg, "-w/--wal-keep-segments", &cli_errors, false);
|
||||
strncpy(runtime_options.wal_keep_segments,
|
||||
optarg,
|
||||
MAXLEN);
|
||||
@@ -354,10 +362,6 @@ main(int argc, char **argv)
|
||||
strncpy(runtime_options.upstream_conninfo, optarg, MAXLEN);
|
||||
break;
|
||||
|
||||
case OPT_UPSTREAM_NODE_ID:
|
||||
//strncpy(runtime_options.upstream_conninfo, optarg, MAXLEN);
|
||||
break;
|
||||
|
||||
case OPT_USE_RECOVERY_CONNINFO_PASSWORD:
|
||||
runtime_options.use_recovery_conninfo_password = true;
|
||||
break;
|
||||
@@ -1075,6 +1079,20 @@ check_cli_parameters(const int action)
|
||||
}
|
||||
}
|
||||
|
||||
if (runtime_options.upstream_node_id != UNKNOWN_NODE_ID)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case STANDBY_CLONE:
|
||||
case STANDBY_REGISTER:
|
||||
break;
|
||||
default:
|
||||
item_list_append_format(&cli_warnings,
|
||||
_("--upstream-node-id will be ignored when executing %s"),
|
||||
action_name(action));
|
||||
}
|
||||
}
|
||||
|
||||
if (runtime_options.event[0])
|
||||
{
|
||||
switch (action)
|
||||
|
||||
Reference in New Issue
Block a user