mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +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);
|
strncpy(runtime_options.node_name, optarg, MAXLEN);
|
||||||
break;
|
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 *
|
/* standby clone options *
|
||||||
* --------------------- */
|
* --------------------- */
|
||||||
|
|
||||||
@@ -311,7 +319,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
/* -w/--wal-keep-segments */
|
/* -w/--wal-keep-segments */
|
||||||
case 'w':
|
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,
|
strncpy(runtime_options.wal_keep_segments,
|
||||||
optarg,
|
optarg,
|
||||||
MAXLEN);
|
MAXLEN);
|
||||||
@@ -354,10 +362,6 @@ main(int argc, char **argv)
|
|||||||
strncpy(runtime_options.upstream_conninfo, optarg, MAXLEN);
|
strncpy(runtime_options.upstream_conninfo, optarg, MAXLEN);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_UPSTREAM_NODE_ID:
|
|
||||||
//strncpy(runtime_options.upstream_conninfo, optarg, MAXLEN);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OPT_USE_RECOVERY_CONNINFO_PASSWORD:
|
case OPT_USE_RECOVERY_CONNINFO_PASSWORD:
|
||||||
runtime_options.use_recovery_conninfo_password = true;
|
runtime_options.use_recovery_conninfo_password = true;
|
||||||
break;
|
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])
|
if (runtime_options.event[0])
|
||||||
{
|
{
|
||||||
switch (action)
|
switch (action)
|
||||||
|
|||||||
Reference in New Issue
Block a user