diff --git a/doc/xml/release.xml b/doc/xml/release.xml index dc4e43ca2..c1181dcad 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -15,6 +15,16 @@ + + + + + + + +

Fix option warnings breaking async archive-get/archive-push.

+
+ @@ -9404,6 +9414,11 @@ L30Bola + + Lev Kokotov + levkk + + loop-evgeny loop-evgeny diff --git a/src/config/parse.c b/src/config/parse.c index 848afacbf..b1d87b94d 100644 --- a/src/config/parse.c +++ b/src/config/parse.c @@ -1108,8 +1108,8 @@ configParse(const Storage *storage, unsigned int argListSize, const char *argLis if (config->paramList != NULL && !config->help && !parseRuleCommand[config->command].parameterAllowed) THROW(ParamInvalidError, "command does not allow parameters"); - // Enable logging (except for local and remote commands) so config file warnings will be output - if (resetLogLevel && config->commandRole != cfgCmdRoleLocal && config->commandRole != cfgCmdRoleRemote) + // Enable logging for default role so config file warnings will be output + if (resetLogLevel && config->commandRole == cfgCmdRoleDefault) logInit(logLevelWarn, logLevelWarn, logLevelOff, false, 0, 1, false); // Only continue if command options need to be validated, i.e. a real command is running or we are getting help for a diff --git a/test/src/module/config/parseTest.c b/test/src/module/config/parseTest.c index 490af78f1..ffd1a6eda 100644 --- a/test/src/module/config/parseTest.c +++ b/test/src/module/config/parseTest.c @@ -777,7 +777,7 @@ testRun(void) "'/path1/path2//' cannot contain // for 'pg1-path' option"); // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("local/remote roles should not modify log levels"); + TEST_TITLE("non-default roles should not modify log levels"); argList = strLstNew(); strLstAdd(argList, strNew("pgbackrest")); @@ -816,6 +816,21 @@ testRun(void) TEST_RESULT_STR_Z(cfgCommandRoleStr(cfgCmdRoleRemote), "remote", " remote role name"); TEST_RESULT_INT(logLevelStdOut, logLevelError, "console logging is error"); TEST_RESULT_INT(logLevelStdErr, logLevelError, "stderr logging is error"); + + argList = strLstNew(); + strLstAdd(argList, strNew("pgbackrest")); + hrnCfgArgRawZ(argList, cfgOptPgPath, "/path/to"); + strLstAdd(argList, strNew("--stanza=db")); + strLstAdd(argList, strNew("--log-level-stderr=info")); + strLstAddZ(argList, CFGCMD_ARCHIVE_GET ":" CONFIG_COMMAND_ROLE_ASYNC); + + logLevelStdOut = logLevelError; + logLevelStdErr = logLevelError; + TEST_RESULT_VOID(configParse(storageTest, strLstSize(argList), strLstPtr(argList), true), "load async config"); + TEST_RESULT_INT(cfgCommandRole(), cfgCmdRoleAsync, " command role is async"); + TEST_RESULT_INT(logLevelStdOut, logLevelError, "console logging is error"); + TEST_RESULT_INT(logLevelStdErr, logLevelError, "stderr logging is error"); + harnessLogLevelReset(); // -------------------------------------------------------------------------------------------------------------------------