mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-14 10:13:05 +02:00
Remove auto-generated option String constants.
These are rarely used and end up using more space than they save since most of them are never referenced. Replace VARSTR() with VARSTRDEF() where these constants are being used.
This commit is contained in:
parent
6a39c51f8f
commit
468aa79ea8
@ -35,7 +35,6 @@ use constant BLDLCL_CONSTANT_OPTION_TOTAL => 'CFG_OPTI
|
||||
|
||||
use constant BLDLCL_DATA_COMMAND_CONSTANT => '01-commandConstant';
|
||||
use constant BLDLCL_DATA_COMMAND => '02-command';
|
||||
use constant BLDLCL_DATA_OPTION_CONSTANT => '04-optionConstant';
|
||||
|
||||
use constant BLDLCL_ENUM_COMMAND => '01-enumCommand';
|
||||
use constant BLDLCL_ENUM_OPTION_GROUP => '02-enumOptionGroup';
|
||||
@ -104,11 +103,6 @@ my $rhBuild =
|
||||
{
|
||||
&BLD_SUMMARY => 'Command data',
|
||||
},
|
||||
|
||||
&BLDLCL_DATA_OPTION_CONSTANT =>
|
||||
{
|
||||
&BLD_SUMMARY => 'Option constants',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -236,8 +230,6 @@ sub buildConfig
|
||||
$rhEnum = $rhBuild->{&BLD_FILE}{&BLDLCL_FILE_CONFIG}{&BLD_ENUM}{&BLDLCL_ENUM_OPTION};
|
||||
my $iOptionTotal = 0;
|
||||
|
||||
$strBuildSourceConstant = '';
|
||||
|
||||
foreach my $strOption (sort(keys(%{$rhConfigDefine})))
|
||||
{
|
||||
# Build C enum
|
||||
@ -252,17 +244,12 @@ sub buildConfig
|
||||
if (!$rhConfigDefine->{$strOption}{&CFGDEF_GROUP})
|
||||
{
|
||||
$rhBuild->{&BLD_FILE}{&BLDLCL_FILE_CONFIG}{&BLD_CONSTANT_GROUP}{&BLDLCL_CONSTANT_OPTION}{&BLD_CONSTANT}
|
||||
{$strOptionConst}{&BLD_CONSTANT_VALUE} = "\"${strOption}\"\n STRING_DECLARE(${strOptionConst}_STR);";
|
||||
|
||||
$strBuildSourceConstant .=
|
||||
"STRING_EXTERN(${strOptionConst}_STR," . (' ' x (49 - length($strOptionConst))) . "${strOptionConst});\n";
|
||||
{$strOptionConst}{&BLD_CONSTANT_VALUE} = "\"${strOption}\"";
|
||||
}
|
||||
|
||||
$iOptionTotal += 1;
|
||||
}
|
||||
|
||||
$rhBuild->{&BLD_FILE}{&BLDLCL_FILE_CONFIG}{&BLD_DATA}{&BLDLCL_DATA_OPTION_CONSTANT}{&BLD_SOURCE} = $strBuildSourceConstant;
|
||||
|
||||
# Add an LF to the last option constant so there's whitespace before the total
|
||||
$rhBuild->{&BLD_FILE}{&BLDLCL_FILE_CONFIG}{&BLD_CONSTANT_GROUP}{&BLDLCL_CONSTANT_OPTION}{&BLD_CONSTANT}
|
||||
{$strOptionConst}{&BLD_CONSTANT_VALUE} .= "\n";
|
||||
|
@ -712,8 +712,8 @@ cmdArchiveGet(void)
|
||||
// The async process should not output on the console at all
|
||||
KeyValue *optionReplace = kvNew();
|
||||
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_CONSOLE_STR), VARSTRDEF("off"));
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_STDERR_STR), VARSTRDEF("off"));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_CONSOLE), VARSTRDEF("off"));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_STDERR), VARSTRDEF("off"));
|
||||
|
||||
// Generate command options
|
||||
StringList *commandExec = cfgExecParam(cfgCmdArchiveGet, cfgCmdRoleAsync, optionReplace, true, false);
|
||||
|
@ -358,8 +358,8 @@ cmdArchivePush(void)
|
||||
// The async process should not output on the console at all
|
||||
KeyValue *optionReplace = kvNew();
|
||||
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_CONSOLE_STR), VARSTRDEF("off"));
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_STDERR_STR), VARSTRDEF("off"));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_CONSOLE), VARSTRDEF("off"));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_STDERR), VARSTRDEF("off"));
|
||||
|
||||
// Generate command options
|
||||
StringList *commandExec = cfgExecParam(cfgCmdArchivePush, cfgCmdRoleAsync, optionReplace, true, false);
|
||||
|
@ -1540,15 +1540,15 @@ restoreRecoveryOption(unsigned int pgVersion)
|
||||
// better than, for example, passing --process-max=32 to archive-get because it was specified for restore.
|
||||
KeyValue *optionReplace = kvNew();
|
||||
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_EXEC_ID_STR), NULL);
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_JOB_RETRY_STR), NULL);
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_JOB_RETRY_INTERVAL_STR), NULL);
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_CONSOLE_STR), NULL);
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_FILE_STR), NULL);
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_STDERR_STR), NULL);
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_SUBPROCESS_STR), NULL);
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_TIMESTAMP_STR), NULL);
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_PROCESS_MAX_STR), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_EXEC_ID), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_JOB_RETRY), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_JOB_RETRY_INTERVAL), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_CONSOLE), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_FILE), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_STDERR), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_SUBPROCESS), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_TIMESTAMP), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_PROCESS_MAX), NULL);
|
||||
|
||||
kvPut(
|
||||
result, VARSTRZ(RESTORE_COMMAND),
|
||||
|
@ -253,83 +253,3 @@ static const ConfigCommandData configCommandData[CFG_COMMAND_TOTAL] = CONFIG_COM
|
||||
CONFIG_COMMAND_LOCK_TYPE(lockTypeNone)
|
||||
)
|
||||
)
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Option constants
|
||||
***********************************************************************************************************************************/
|
||||
STRING_EXTERN(CFGOPT_ARCHIVE_ASYNC_STR, CFGOPT_ARCHIVE_ASYNC);
|
||||
STRING_EXTERN(CFGOPT_ARCHIVE_CHECK_STR, CFGOPT_ARCHIVE_CHECK);
|
||||
STRING_EXTERN(CFGOPT_ARCHIVE_COPY_STR, CFGOPT_ARCHIVE_COPY);
|
||||
STRING_EXTERN(CFGOPT_ARCHIVE_GET_QUEUE_MAX_STR, CFGOPT_ARCHIVE_GET_QUEUE_MAX);
|
||||
STRING_EXTERN(CFGOPT_ARCHIVE_HEADER_CHECK_STR, CFGOPT_ARCHIVE_HEADER_CHECK);
|
||||
STRING_EXTERN(CFGOPT_ARCHIVE_MODE_STR, CFGOPT_ARCHIVE_MODE);
|
||||
STRING_EXTERN(CFGOPT_ARCHIVE_MODE_CHECK_STR, CFGOPT_ARCHIVE_MODE_CHECK);
|
||||
STRING_EXTERN(CFGOPT_ARCHIVE_PUSH_QUEUE_MAX_STR, CFGOPT_ARCHIVE_PUSH_QUEUE_MAX);
|
||||
STRING_EXTERN(CFGOPT_ARCHIVE_TIMEOUT_STR, CFGOPT_ARCHIVE_TIMEOUT);
|
||||
STRING_EXTERN(CFGOPT_BACKUP_STANDBY_STR, CFGOPT_BACKUP_STANDBY);
|
||||
STRING_EXTERN(CFGOPT_BUFFER_SIZE_STR, CFGOPT_BUFFER_SIZE);
|
||||
STRING_EXTERN(CFGOPT_CHECKSUM_PAGE_STR, CFGOPT_CHECKSUM_PAGE);
|
||||
STRING_EXTERN(CFGOPT_CIPHER_PASS_STR, CFGOPT_CIPHER_PASS);
|
||||
STRING_EXTERN(CFGOPT_CMD_SSH_STR, CFGOPT_CMD_SSH);
|
||||
STRING_EXTERN(CFGOPT_COMPRESS_STR, CFGOPT_COMPRESS);
|
||||
STRING_EXTERN(CFGOPT_COMPRESS_LEVEL_STR, CFGOPT_COMPRESS_LEVEL);
|
||||
STRING_EXTERN(CFGOPT_COMPRESS_LEVEL_NETWORK_STR, CFGOPT_COMPRESS_LEVEL_NETWORK);
|
||||
STRING_EXTERN(CFGOPT_COMPRESS_TYPE_STR, CFGOPT_COMPRESS_TYPE);
|
||||
STRING_EXTERN(CFGOPT_CONFIG_STR, CFGOPT_CONFIG);
|
||||
STRING_EXTERN(CFGOPT_CONFIG_INCLUDE_PATH_STR, CFGOPT_CONFIG_INCLUDE_PATH);
|
||||
STRING_EXTERN(CFGOPT_CONFIG_PATH_STR, CFGOPT_CONFIG_PATH);
|
||||
STRING_EXTERN(CFGOPT_DB_EXCLUDE_STR, CFGOPT_DB_EXCLUDE);
|
||||
STRING_EXTERN(CFGOPT_DB_INCLUDE_STR, CFGOPT_DB_INCLUDE);
|
||||
STRING_EXTERN(CFGOPT_DB_TIMEOUT_STR, CFGOPT_DB_TIMEOUT);
|
||||
STRING_EXTERN(CFGOPT_DELTA_STR, CFGOPT_DELTA);
|
||||
STRING_EXTERN(CFGOPT_DRY_RUN_STR, CFGOPT_DRY_RUN);
|
||||
STRING_EXTERN(CFGOPT_EXCLUDE_STR, CFGOPT_EXCLUDE);
|
||||
STRING_EXTERN(CFGOPT_EXEC_ID_STR, CFGOPT_EXEC_ID);
|
||||
STRING_EXTERN(CFGOPT_EXPIRE_AUTO_STR, CFGOPT_EXPIRE_AUTO);
|
||||
STRING_EXTERN(CFGOPT_FILTER_STR, CFGOPT_FILTER);
|
||||
STRING_EXTERN(CFGOPT_FORCE_STR, CFGOPT_FORCE);
|
||||
STRING_EXTERN(CFGOPT_IGNORE_MISSING_STR, CFGOPT_IGNORE_MISSING);
|
||||
STRING_EXTERN(CFGOPT_IO_TIMEOUT_STR, CFGOPT_IO_TIMEOUT);
|
||||
STRING_EXTERN(CFGOPT_JOB_RETRY_STR, CFGOPT_JOB_RETRY);
|
||||
STRING_EXTERN(CFGOPT_JOB_RETRY_INTERVAL_STR, CFGOPT_JOB_RETRY_INTERVAL);
|
||||
STRING_EXTERN(CFGOPT_LINK_ALL_STR, CFGOPT_LINK_ALL);
|
||||
STRING_EXTERN(CFGOPT_LINK_MAP_STR, CFGOPT_LINK_MAP);
|
||||
STRING_EXTERN(CFGOPT_LOCK_PATH_STR, CFGOPT_LOCK_PATH);
|
||||
STRING_EXTERN(CFGOPT_LOG_LEVEL_CONSOLE_STR, CFGOPT_LOG_LEVEL_CONSOLE);
|
||||
STRING_EXTERN(CFGOPT_LOG_LEVEL_FILE_STR, CFGOPT_LOG_LEVEL_FILE);
|
||||
STRING_EXTERN(CFGOPT_LOG_LEVEL_STDERR_STR, CFGOPT_LOG_LEVEL_STDERR);
|
||||
STRING_EXTERN(CFGOPT_LOG_PATH_STR, CFGOPT_LOG_PATH);
|
||||
STRING_EXTERN(CFGOPT_LOG_SUBPROCESS_STR, CFGOPT_LOG_SUBPROCESS);
|
||||
STRING_EXTERN(CFGOPT_LOG_TIMESTAMP_STR, CFGOPT_LOG_TIMESTAMP);
|
||||
STRING_EXTERN(CFGOPT_MANIFEST_SAVE_THRESHOLD_STR, CFGOPT_MANIFEST_SAVE_THRESHOLD);
|
||||
STRING_EXTERN(CFGOPT_NEUTRAL_UMASK_STR, CFGOPT_NEUTRAL_UMASK);
|
||||
STRING_EXTERN(CFGOPT_ONLINE_STR, CFGOPT_ONLINE);
|
||||
STRING_EXTERN(CFGOPT_OUTPUT_STR, CFGOPT_OUTPUT);
|
||||
STRING_EXTERN(CFGOPT_PG_STR, CFGOPT_PG);
|
||||
STRING_EXTERN(CFGOPT_PROCESS_STR, CFGOPT_PROCESS);
|
||||
STRING_EXTERN(CFGOPT_PROCESS_MAX_STR, CFGOPT_PROCESS_MAX);
|
||||
STRING_EXTERN(CFGOPT_PROTOCOL_TIMEOUT_STR, CFGOPT_PROTOCOL_TIMEOUT);
|
||||
STRING_EXTERN(CFGOPT_RAW_STR, CFGOPT_RAW);
|
||||
STRING_EXTERN(CFGOPT_RECOVERY_OPTION_STR, CFGOPT_RECOVERY_OPTION);
|
||||
STRING_EXTERN(CFGOPT_RECURSE_STR, CFGOPT_RECURSE);
|
||||
STRING_EXTERN(CFGOPT_REMOTE_TYPE_STR, CFGOPT_REMOTE_TYPE);
|
||||
STRING_EXTERN(CFGOPT_REPO_STR, CFGOPT_REPO);
|
||||
STRING_EXTERN(CFGOPT_RESUME_STR, CFGOPT_RESUME);
|
||||
STRING_EXTERN(CFGOPT_SCK_BLOCK_STR, CFGOPT_SCK_BLOCK);
|
||||
STRING_EXTERN(CFGOPT_SCK_KEEP_ALIVE_STR, CFGOPT_SCK_KEEP_ALIVE);
|
||||
STRING_EXTERN(CFGOPT_SET_STR, CFGOPT_SET);
|
||||
STRING_EXTERN(CFGOPT_SORT_STR, CFGOPT_SORT);
|
||||
STRING_EXTERN(CFGOPT_SPOOL_PATH_STR, CFGOPT_SPOOL_PATH);
|
||||
STRING_EXTERN(CFGOPT_STANZA_STR, CFGOPT_STANZA);
|
||||
STRING_EXTERN(CFGOPT_START_FAST_STR, CFGOPT_START_FAST);
|
||||
STRING_EXTERN(CFGOPT_STOP_AUTO_STR, CFGOPT_STOP_AUTO);
|
||||
STRING_EXTERN(CFGOPT_TABLESPACE_MAP_STR, CFGOPT_TABLESPACE_MAP);
|
||||
STRING_EXTERN(CFGOPT_TABLESPACE_MAP_ALL_STR, CFGOPT_TABLESPACE_MAP_ALL);
|
||||
STRING_EXTERN(CFGOPT_TARGET_STR, CFGOPT_TARGET);
|
||||
STRING_EXTERN(CFGOPT_TARGET_ACTION_STR, CFGOPT_TARGET_ACTION);
|
||||
STRING_EXTERN(CFGOPT_TARGET_EXCLUSIVE_STR, CFGOPT_TARGET_EXCLUSIVE);
|
||||
STRING_EXTERN(CFGOPT_TARGET_TIMELINE_STR, CFGOPT_TARGET_TIMELINE);
|
||||
STRING_EXTERN(CFGOPT_TCP_KEEP_ALIVE_COUNT_STR, CFGOPT_TCP_KEEP_ALIVE_COUNT);
|
||||
STRING_EXTERN(CFGOPT_TCP_KEEP_ALIVE_IDLE_STR, CFGOPT_TCP_KEEP_ALIVE_IDLE);
|
||||
STRING_EXTERN(CFGOPT_TCP_KEEP_ALIVE_INTERVAL_STR, CFGOPT_TCP_KEEP_ALIVE_INTERVAL);
|
||||
STRING_EXTERN(CFGOPT_TYPE_STR, CFGOPT_TYPE);
|
||||
|
@ -61,157 +61,81 @@ Option group constants
|
||||
Option constants
|
||||
***********************************************************************************************************************************/
|
||||
#define CFGOPT_ARCHIVE_ASYNC "archive-async"
|
||||
STRING_DECLARE(CFGOPT_ARCHIVE_ASYNC_STR);
|
||||
#define CFGOPT_ARCHIVE_CHECK "archive-check"
|
||||
STRING_DECLARE(CFGOPT_ARCHIVE_CHECK_STR);
|
||||
#define CFGOPT_ARCHIVE_COPY "archive-copy"
|
||||
STRING_DECLARE(CFGOPT_ARCHIVE_COPY_STR);
|
||||
#define CFGOPT_ARCHIVE_GET_QUEUE_MAX "archive-get-queue-max"
|
||||
STRING_DECLARE(CFGOPT_ARCHIVE_GET_QUEUE_MAX_STR);
|
||||
#define CFGOPT_ARCHIVE_HEADER_CHECK "archive-header-check"
|
||||
STRING_DECLARE(CFGOPT_ARCHIVE_HEADER_CHECK_STR);
|
||||
#define CFGOPT_ARCHIVE_MODE "archive-mode"
|
||||
STRING_DECLARE(CFGOPT_ARCHIVE_MODE_STR);
|
||||
#define CFGOPT_ARCHIVE_MODE_CHECK "archive-mode-check"
|
||||
STRING_DECLARE(CFGOPT_ARCHIVE_MODE_CHECK_STR);
|
||||
#define CFGOPT_ARCHIVE_PUSH_QUEUE_MAX "archive-push-queue-max"
|
||||
STRING_DECLARE(CFGOPT_ARCHIVE_PUSH_QUEUE_MAX_STR);
|
||||
#define CFGOPT_ARCHIVE_TIMEOUT "archive-timeout"
|
||||
STRING_DECLARE(CFGOPT_ARCHIVE_TIMEOUT_STR);
|
||||
#define CFGOPT_BACKUP_STANDBY "backup-standby"
|
||||
STRING_DECLARE(CFGOPT_BACKUP_STANDBY_STR);
|
||||
#define CFGOPT_BUFFER_SIZE "buffer-size"
|
||||
STRING_DECLARE(CFGOPT_BUFFER_SIZE_STR);
|
||||
#define CFGOPT_CHECKSUM_PAGE "checksum-page"
|
||||
STRING_DECLARE(CFGOPT_CHECKSUM_PAGE_STR);
|
||||
#define CFGOPT_CIPHER_PASS "cipher-pass"
|
||||
STRING_DECLARE(CFGOPT_CIPHER_PASS_STR);
|
||||
#define CFGOPT_CMD_SSH "cmd-ssh"
|
||||
STRING_DECLARE(CFGOPT_CMD_SSH_STR);
|
||||
#define CFGOPT_COMPRESS "compress"
|
||||
STRING_DECLARE(CFGOPT_COMPRESS_STR);
|
||||
#define CFGOPT_COMPRESS_LEVEL "compress-level"
|
||||
STRING_DECLARE(CFGOPT_COMPRESS_LEVEL_STR);
|
||||
#define CFGOPT_COMPRESS_LEVEL_NETWORK "compress-level-network"
|
||||
STRING_DECLARE(CFGOPT_COMPRESS_LEVEL_NETWORK_STR);
|
||||
#define CFGOPT_COMPRESS_TYPE "compress-type"
|
||||
STRING_DECLARE(CFGOPT_COMPRESS_TYPE_STR);
|
||||
#define CFGOPT_CONFIG "config"
|
||||
STRING_DECLARE(CFGOPT_CONFIG_STR);
|
||||
#define CFGOPT_CONFIG_INCLUDE_PATH "config-include-path"
|
||||
STRING_DECLARE(CFGOPT_CONFIG_INCLUDE_PATH_STR);
|
||||
#define CFGOPT_CONFIG_PATH "config-path"
|
||||
STRING_DECLARE(CFGOPT_CONFIG_PATH_STR);
|
||||
#define CFGOPT_DB_EXCLUDE "db-exclude"
|
||||
STRING_DECLARE(CFGOPT_DB_EXCLUDE_STR);
|
||||
#define CFGOPT_DB_INCLUDE "db-include"
|
||||
STRING_DECLARE(CFGOPT_DB_INCLUDE_STR);
|
||||
#define CFGOPT_DB_TIMEOUT "db-timeout"
|
||||
STRING_DECLARE(CFGOPT_DB_TIMEOUT_STR);
|
||||
#define CFGOPT_DELTA "delta"
|
||||
STRING_DECLARE(CFGOPT_DELTA_STR);
|
||||
#define CFGOPT_DRY_RUN "dry-run"
|
||||
STRING_DECLARE(CFGOPT_DRY_RUN_STR);
|
||||
#define CFGOPT_EXCLUDE "exclude"
|
||||
STRING_DECLARE(CFGOPT_EXCLUDE_STR);
|
||||
#define CFGOPT_EXEC_ID "exec-id"
|
||||
STRING_DECLARE(CFGOPT_EXEC_ID_STR);
|
||||
#define CFGOPT_EXPIRE_AUTO "expire-auto"
|
||||
STRING_DECLARE(CFGOPT_EXPIRE_AUTO_STR);
|
||||
#define CFGOPT_FILTER "filter"
|
||||
STRING_DECLARE(CFGOPT_FILTER_STR);
|
||||
#define CFGOPT_FORCE "force"
|
||||
STRING_DECLARE(CFGOPT_FORCE_STR);
|
||||
#define CFGOPT_IGNORE_MISSING "ignore-missing"
|
||||
STRING_DECLARE(CFGOPT_IGNORE_MISSING_STR);
|
||||
#define CFGOPT_IO_TIMEOUT "io-timeout"
|
||||
STRING_DECLARE(CFGOPT_IO_TIMEOUT_STR);
|
||||
#define CFGOPT_JOB_RETRY "job-retry"
|
||||
STRING_DECLARE(CFGOPT_JOB_RETRY_STR);
|
||||
#define CFGOPT_JOB_RETRY_INTERVAL "job-retry-interval"
|
||||
STRING_DECLARE(CFGOPT_JOB_RETRY_INTERVAL_STR);
|
||||
#define CFGOPT_LINK_ALL "link-all"
|
||||
STRING_DECLARE(CFGOPT_LINK_ALL_STR);
|
||||
#define CFGOPT_LINK_MAP "link-map"
|
||||
STRING_DECLARE(CFGOPT_LINK_MAP_STR);
|
||||
#define CFGOPT_LOCK_PATH "lock-path"
|
||||
STRING_DECLARE(CFGOPT_LOCK_PATH_STR);
|
||||
#define CFGOPT_LOG_LEVEL_CONSOLE "log-level-console"
|
||||
STRING_DECLARE(CFGOPT_LOG_LEVEL_CONSOLE_STR);
|
||||
#define CFGOPT_LOG_LEVEL_FILE "log-level-file"
|
||||
STRING_DECLARE(CFGOPT_LOG_LEVEL_FILE_STR);
|
||||
#define CFGOPT_LOG_LEVEL_STDERR "log-level-stderr"
|
||||
STRING_DECLARE(CFGOPT_LOG_LEVEL_STDERR_STR);
|
||||
#define CFGOPT_LOG_PATH "log-path"
|
||||
STRING_DECLARE(CFGOPT_LOG_PATH_STR);
|
||||
#define CFGOPT_LOG_SUBPROCESS "log-subprocess"
|
||||
STRING_DECLARE(CFGOPT_LOG_SUBPROCESS_STR);
|
||||
#define CFGOPT_LOG_TIMESTAMP "log-timestamp"
|
||||
STRING_DECLARE(CFGOPT_LOG_TIMESTAMP_STR);
|
||||
#define CFGOPT_MANIFEST_SAVE_THRESHOLD "manifest-save-threshold"
|
||||
STRING_DECLARE(CFGOPT_MANIFEST_SAVE_THRESHOLD_STR);
|
||||
#define CFGOPT_NEUTRAL_UMASK "neutral-umask"
|
||||
STRING_DECLARE(CFGOPT_NEUTRAL_UMASK_STR);
|
||||
#define CFGOPT_ONLINE "online"
|
||||
STRING_DECLARE(CFGOPT_ONLINE_STR);
|
||||
#define CFGOPT_OUTPUT "output"
|
||||
STRING_DECLARE(CFGOPT_OUTPUT_STR);
|
||||
#define CFGOPT_PG "pg"
|
||||
STRING_DECLARE(CFGOPT_PG_STR);
|
||||
#define CFGOPT_PROCESS "process"
|
||||
STRING_DECLARE(CFGOPT_PROCESS_STR);
|
||||
#define CFGOPT_PROCESS_MAX "process-max"
|
||||
STRING_DECLARE(CFGOPT_PROCESS_MAX_STR);
|
||||
#define CFGOPT_PROTOCOL_TIMEOUT "protocol-timeout"
|
||||
STRING_DECLARE(CFGOPT_PROTOCOL_TIMEOUT_STR);
|
||||
#define CFGOPT_RAW "raw"
|
||||
STRING_DECLARE(CFGOPT_RAW_STR);
|
||||
#define CFGOPT_RECOVERY_OPTION "recovery-option"
|
||||
STRING_DECLARE(CFGOPT_RECOVERY_OPTION_STR);
|
||||
#define CFGOPT_RECURSE "recurse"
|
||||
STRING_DECLARE(CFGOPT_RECURSE_STR);
|
||||
#define CFGOPT_REMOTE_TYPE "remote-type"
|
||||
STRING_DECLARE(CFGOPT_REMOTE_TYPE_STR);
|
||||
#define CFGOPT_REPO "repo"
|
||||
STRING_DECLARE(CFGOPT_REPO_STR);
|
||||
#define CFGOPT_RESUME "resume"
|
||||
STRING_DECLARE(CFGOPT_RESUME_STR);
|
||||
#define CFGOPT_SCK_BLOCK "sck-block"
|
||||
STRING_DECLARE(CFGOPT_SCK_BLOCK_STR);
|
||||
#define CFGOPT_SCK_KEEP_ALIVE "sck-keep-alive"
|
||||
STRING_DECLARE(CFGOPT_SCK_KEEP_ALIVE_STR);
|
||||
#define CFGOPT_SET "set"
|
||||
STRING_DECLARE(CFGOPT_SET_STR);
|
||||
#define CFGOPT_SORT "sort"
|
||||
STRING_DECLARE(CFGOPT_SORT_STR);
|
||||
#define CFGOPT_SPOOL_PATH "spool-path"
|
||||
STRING_DECLARE(CFGOPT_SPOOL_PATH_STR);
|
||||
#define CFGOPT_STANZA "stanza"
|
||||
STRING_DECLARE(CFGOPT_STANZA_STR);
|
||||
#define CFGOPT_START_FAST "start-fast"
|
||||
STRING_DECLARE(CFGOPT_START_FAST_STR);
|
||||
#define CFGOPT_STOP_AUTO "stop-auto"
|
||||
STRING_DECLARE(CFGOPT_STOP_AUTO_STR);
|
||||
#define CFGOPT_TABLESPACE_MAP "tablespace-map"
|
||||
STRING_DECLARE(CFGOPT_TABLESPACE_MAP_STR);
|
||||
#define CFGOPT_TABLESPACE_MAP_ALL "tablespace-map-all"
|
||||
STRING_DECLARE(CFGOPT_TABLESPACE_MAP_ALL_STR);
|
||||
#define CFGOPT_TARGET "target"
|
||||
STRING_DECLARE(CFGOPT_TARGET_STR);
|
||||
#define CFGOPT_TARGET_ACTION "target-action"
|
||||
STRING_DECLARE(CFGOPT_TARGET_ACTION_STR);
|
||||
#define CFGOPT_TARGET_EXCLUSIVE "target-exclusive"
|
||||
STRING_DECLARE(CFGOPT_TARGET_EXCLUSIVE_STR);
|
||||
#define CFGOPT_TARGET_TIMELINE "target-timeline"
|
||||
STRING_DECLARE(CFGOPT_TARGET_TIMELINE_STR);
|
||||
#define CFGOPT_TCP_KEEP_ALIVE_COUNT "tcp-keep-alive-count"
|
||||
STRING_DECLARE(CFGOPT_TCP_KEEP_ALIVE_COUNT_STR);
|
||||
#define CFGOPT_TCP_KEEP_ALIVE_IDLE "tcp-keep-alive-idle"
|
||||
STRING_DECLARE(CFGOPT_TCP_KEEP_ALIVE_IDLE_STR);
|
||||
#define CFGOPT_TCP_KEEP_ALIVE_INTERVAL "tcp-keep-alive-interval"
|
||||
STRING_DECLARE(CFGOPT_TCP_KEEP_ALIVE_INTERVAL_STR);
|
||||
#define CFGOPT_TYPE "type"
|
||||
STRING_DECLARE(CFGOPT_TYPE_STR);
|
||||
|
||||
#define CFG_OPTION_TOTAL 130
|
||||
|
||||
|
@ -145,7 +145,7 @@ protocolLocalParam(ProtocolStorageType protocolStorageType, unsigned int hostIdx
|
||||
KeyValue *optionReplace = kvNew();
|
||||
|
||||
// Add the process id -- used when more than one process will be called
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_PROCESS_STR), VARUINT(processId));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_PROCESS), VARUINT(processId));
|
||||
|
||||
// Add the pg default. Don't do this for repos because the repo default should come from the user or the local should
|
||||
// handle all the repos equally. Repos don't get special handling like pg primaries or standbys.
|
||||
@ -153,18 +153,18 @@ protocolLocalParam(ProtocolStorageType protocolStorageType, unsigned int hostIdx
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_PG), VARUINT(cfgOptionGroupIdxToKey(cfgOptGrpPg, hostIdx)));
|
||||
|
||||
// Add the remote type
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_REMOTE_TYPE_STR), VARSTR(protocolStorageTypeStr(protocolStorageType)));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_REMOTE_TYPE), VARSTR(protocolStorageTypeStr(protocolStorageType)));
|
||||
|
||||
// Only enable file logging on the local when requested
|
||||
kvPut(
|
||||
optionReplace, VARSTR(CFGOPT_LOG_LEVEL_FILE_STR),
|
||||
optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_FILE),
|
||||
cfgOptionBool(cfgOptLogSubprocess) ? cfgOption(cfgOptLogLevelFile) : VARSTRDEF("off"));
|
||||
|
||||
// Always output errors on stderr for debugging purposes
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_STDERR_STR), VARSTRDEF("error"));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_STDERR), VARSTRDEF("error"));
|
||||
|
||||
// Disable output to stdout since it is used by the protocol
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_CONSOLE_STR), VARSTRDEF("off"));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_CONSOLE), VARSTRDEF("off"));
|
||||
|
||||
result = strLstMove(cfgExecParam(cfgCommand(), cfgCmdRoleLocal, optionReplace, true, false), memContextPrior());
|
||||
}
|
||||
@ -332,20 +332,20 @@ protocolRemoteParam(ProtocolStorageType protocolStorageType, unsigned int hostId
|
||||
unsigned int optConfig = isRepo ? cfgOptRepoHostConfig : cfgOptPgHostConfig;
|
||||
|
||||
kvPut(
|
||||
optionReplace, VARSTR(CFGOPT_CONFIG_STR),
|
||||
optionReplace, VARSTRDEF(CFGOPT_CONFIG),
|
||||
cfgOptionIdxSource(optConfig, hostIdx) != cfgSourceDefault ? VARSTR(cfgOptionIdxStr(optConfig, hostIdx)) : NULL);
|
||||
|
||||
unsigned int optConfigIncludePath = isRepo ? cfgOptRepoHostConfigIncludePath : cfgOptPgHostConfigIncludePath;
|
||||
|
||||
kvPut(
|
||||
optionReplace, VARSTR(CFGOPT_CONFIG_INCLUDE_PATH_STR),
|
||||
optionReplace, VARSTRDEF(CFGOPT_CONFIG_INCLUDE_PATH),
|
||||
cfgOptionIdxSource(optConfigIncludePath, hostIdx) != cfgSourceDefault ?
|
||||
VARSTR(cfgOptionIdxStr(optConfigIncludePath, hostIdx)) : NULL);
|
||||
|
||||
unsigned int optConfigPath = isRepo ? cfgOptRepoHostConfigPath : cfgOptPgHostConfigPath;
|
||||
|
||||
kvPut(
|
||||
optionReplace, VARSTR(CFGOPT_CONFIG_PATH_STR),
|
||||
optionReplace, VARSTRDEF(CFGOPT_CONFIG_PATH),
|
||||
cfgOptionIdxSource(optConfigPath, hostIdx) != cfgSourceDefault ? VARSTR(cfgOptionIdxStr(optConfigPath, hostIdx)) : NULL);
|
||||
|
||||
// Update/remove repo/pg options that are sent to the remote
|
||||
@ -408,25 +408,25 @@ protocolRemoteParam(ProtocolStorageType protocolStorageType, unsigned int hostId
|
||||
// Add the process id if not set. This means that the remote is being started from the main process and should always get a
|
||||
// process id of 0.
|
||||
if (!cfgOptionTest(cfgOptProcess))
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_PROCESS_STR), VARINT(0));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_PROCESS), VARINT(0));
|
||||
|
||||
// Don't pass log-path or lock-path since these are host specific
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_PATH_STR), NULL);
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOCK_PATH_STR), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_PATH), NULL);
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOCK_PATH), NULL);
|
||||
|
||||
// Only enable file logging on the remote when requested
|
||||
kvPut(
|
||||
optionReplace, VARSTR(CFGOPT_LOG_LEVEL_FILE_STR),
|
||||
optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_FILE),
|
||||
cfgOptionBool(cfgOptLogSubprocess) ? cfgOption(cfgOptLogLevelFile) : VARSTRDEF("off"));
|
||||
|
||||
// Always output errors on stderr for debugging purposes
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_STDERR_STR), VARSTRDEF("error"));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_STDERR), VARSTRDEF("error"));
|
||||
|
||||
// Disable output to stdout since it is used by the protocol
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_CONSOLE_STR), VARSTRDEF("off"));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_LOG_LEVEL_CONSOLE), VARSTRDEF("off"));
|
||||
|
||||
// Add the remote type
|
||||
kvPut(optionReplace, VARSTR(CFGOPT_REMOTE_TYPE_STR), VARSTR(protocolStorageTypeStr(protocolStorageType)));
|
||||
kvPut(optionReplace, VARSTRDEF(CFGOPT_REMOTE_TYPE), VARSTR(protocolStorageTypeStr(protocolStorageType)));
|
||||
|
||||
StringList *commandExec = cfgExecParam(cfgCommand(), cfgCmdRoleRemote, optionReplace, false, true);
|
||||
strLstInsert(commandExec, 0, cfgOptionIdxStr(isRepo ? cfgOptRepoHostCmd : cfgOptPgHostCmd, hostIdx));
|
||||
|
Loading…
Reference in New Issue
Block a user