From 3bd3545db8bf805f6a1cfceb569de0f5e0d6816b Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 28 Dec 2021 17:11:28 +0800 Subject: [PATCH] [TS-981](other): allow config offlineInterval dynamically --- src/client/src/tscSQLParser.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 4d63438c9a..935d1462b8 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -7265,6 +7265,7 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) { const int tokenMonitor = 3; const int tokenDebugFlag = 4; const int tokenDebugFlagEnd = 20; + const int tokenOfflineInterval = 21; const SDNodeDynConfOption cfgOptions[] = { {"resetLog", 8}, {"resetQueryCache", 15}, {"balance", 7}, {"monitor", 7}, {"debugFlag", 9}, {"monDebugFlag", 12}, {"vDebugFlag", 10}, {"mDebugFlag", 10}, @@ -7272,6 +7273,7 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) { {"uDebugFlag", 10}, {"tsdbDebugFlag", 13}, {"sDebugflag", 10}, {"rpcDebugFlag", 12}, {"dDebugFlag", 10}, {"mqttDebugFlag", 13}, {"wDebugFlag", 10}, {"tmrDebugFlag", 12}, {"cqDebugFlag", 11}, + {"offlineInterval", 15}, }; SStrToken* pOptionToken = taosArrayGet(pOptions->a, 1); @@ -7303,6 +7305,14 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) { return TSDB_CODE_TSC_INVALID_OPERATION; // options value is invalid } return TSDB_CODE_SUCCESS; + } else if ((strncasecmp(cfgOptions[tokenOfflineInterval].name, pOptionToken->z, pOptionToken->n) == 0) && + (cfgOptions[tokenOfflineInterval].len == pOptionToken->n)) { + SStrToken* pValToken = taosArrayGet(pOptions->a, 2); + int32_t val = strtol(pValToken->z, NULL, 10); + if (val < 1 || val > 600) { + return TSDB_CODE_TSC_INVALID_OPERATION; // options value is invalid + } + return TSDB_CODE_SUCCESS; } else { SStrToken* pValToken = taosArrayGet(pOptions->a, 2); -- GitLab