From 542f54297d98fc3c689357a22b78b81c09c56003 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 4 Mar 2025 19:48:21 +0800 Subject: [PATCH 1/3] feat:[TS-5991]update-retryWaitTime-minValue --- docs/en/14-reference/01-components/01-taosd.md | 2 +- docs/zh/14-reference/01-components/01-taosd.md | 2 +- source/common/src/tglobal.c | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/en/14-reference/01-components/01-taosd.md b/docs/en/14-reference/01-components/01-taosd.md index 449e529cf2..c3c202f085 100644 --- a/docs/en/14-reference/01-components/01-taosd.md +++ b/docs/en/14-reference/01-components/01-taosd.md @@ -43,7 +43,7 @@ After modifying configuration file parameters, you need to restart the *taosd* s |resolveFQDNRetryTime | Cancelled after 3.x |Not supported |Number of retries when FQDN resolution fails| |timeToGetAvailableConn | Cancelled after 3.3.4.x |Maximum waiting time to get an available connection, range 10-50000000, in milliseconds, default value 500000| |maxShellConns | Cancelled after 3.x |Supported, effective after restart|Maximum number of connections allowed| -|maxRetryWaitTime | |Supported, effective after restart|Maximum timeout for reconnection,calculated from the time of retry,range is 0-86400000,in milliseconds, default value 10000| +|maxRetryWaitTime | |Supported, effective after restart|Maximum timeout for reconnection,calculated from the time of retry,range is 3000-86400000,in milliseconds, default value 10000| |shareConnLimit |Added in 3.3.4.0 |Supported, effective after restart|Number of requests a connection can share, range 1-512, default value 10| |readTimeout |Added in 3.3.4.0 |Supported, effective after restart|Minimum timeout for a single request, range 64-604800, in seconds, default value 900| diff --git a/docs/zh/14-reference/01-components/01-taosd.md b/docs/zh/14-reference/01-components/01-taosd.md index dab5039b2f..5b02410992 100644 --- a/docs/zh/14-reference/01-components/01-taosd.md +++ b/docs/zh/14-reference/01-components/01-taosd.md @@ -147,7 +147,7 @@ taosd 命令行参数如下 - 类型:整数 - 单位:毫秒 - 默认值:10000 -- 最小值:0 +- 最小值:3000 - 最大值:86400000 - 动态修改:支持通过 SQL 修改,重启后生效 - 支持版本:从 v3.3.4.0 版本开始引入 diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 5c929530b0..f2a5c67554 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -14,12 +14,12 @@ */ #define _DEFAULT_SOURCE +#include "tglobal.h" #include "cJSON.h" #include "defines.h" #include "os.h" #include "osString.h" #include "tconfig.h" -#include "tglobal.h" #include "tgrant.h" #include "tjson.h" #include "tlog.h" @@ -28,7 +28,6 @@ #include "tutil.h" - #define CONFIG_PATH_LEN (TSDB_FILENAME_LEN + 12) #define CONFIG_FILE_LEN (CONFIG_PATH_LEN + 32) @@ -497,9 +496,7 @@ int32_t taosSetS3Cfg(SConfig *pCfg) { TAOS_RETURN(TSDB_CODE_SUCCESS); } -struct SConfig *taosGetCfg() { - return tsCfg; -} +struct SConfig *taosGetCfg() { return tsCfg; } static int32_t taosLoadCfg(SConfig *pCfg, const char **envCmd, const char *inputCfgDir, const char *envFile, char *apolloUrl) { @@ -688,7 +685,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { CFG_DYN_CLIENT, CFG_CATEGORY_LOCAL)); TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "maxInsertBatchRows", tsMaxInsertBatchRows, 1, INT32_MAX, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT, CFG_CATEGORY_LOCAL) != 0); - TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "maxRetryWaitTime", tsMaxRetryWaitTime, 0, 86400000, CFG_SCOPE_SERVER, + TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "maxRetryWaitTime", tsMaxRetryWaitTime, 3000, 86400000, CFG_SCOPE_SERVER, CFG_DYN_BOTH_LAZY, CFG_CATEGORY_GLOBAL)); TAOS_CHECK_RETURN(cfgAddBool(pCfg, "useAdapter", tsUseAdapter, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT, CFG_CATEGORY_LOCAL)); TAOS_CHECK_RETURN( From b1b4bc806e870321ae2afde9dedccd7da2026b3d Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 5 Mar 2025 09:51:29 +0800 Subject: [PATCH 2/3] feat[client]: update retryWaitTime minValue --- source/client/src/clientEnv.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 11bdb16eca..c554cc4f6c 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -27,6 +27,7 @@ #include "scheduler.h" #include "tcache.h" #include "tcompare.h" +#include "tconv.h" #include "tglobal.h" #include "thttp.h" #include "tmsg.h" @@ -36,7 +37,6 @@ #include "tsched.h" #include "ttime.h" #include "tversion.h" -#include "tconv.h" #include "cus_name.h" @@ -63,13 +63,13 @@ } \ } while (0) -STscDbg tscDbg = {0}; -SAppInfo appInfo; -int64_t lastClusterId = 0; -int32_t clientReqRefPool = -1; -int32_t clientConnRefPool = -1; -int32_t clientStop = -1; -SHashObj* pTimezoneMap = NULL; +STscDbg tscDbg = {0}; +SAppInfo appInfo; +int64_t lastClusterId = 0; +int32_t clientReqRefPool = -1; +int32_t clientConnRefPool = -1; +int32_t clientStop = -1; +SHashObj *pTimezoneMap = NULL; int32_t timestampDeltaLimit = 900; // s @@ -380,7 +380,6 @@ int32_t openTransporter(const char *user, const char *auth, int32_t numOfThread, tscError("invalid version string."); return code; } - *pDnodeConn = rpcOpen(&rpcInit); if (*pDnodeConn == NULL) { tscError("failed to init connection to server since %s", tstrerror(terrno)); @@ -968,7 +967,7 @@ void taos_init_imp(void) { ENV_ERR_RET(taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1), "failed to init cfg"); initQueryModuleMsgHandle(); - if ((tsCharsetCxt = taosConvInit(tsCharset)) == NULL){ + if ((tsCharsetCxt = taosConvInit(tsCharset)) == NULL) { tscInitRes = terrno; tscError("failed to init conv"); return; From f558a3bdbdc6d0a613373257ee6af9de5921b01a Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 5 Mar 2025 10:07:52 +0800 Subject: [PATCH 3/3] feat(client): update retryWaitTime minValue --- source/client/src/clientEnv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index c554cc4f6c..49317d334e 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -380,6 +380,7 @@ int32_t openTransporter(const char *user, const char *auth, int32_t numOfThread, tscError("invalid version string."); return code; } + *pDnodeConn = rpcOpen(&rpcInit); if (*pDnodeConn == NULL) { tscError("failed to init connection to server since %s", tstrerror(terrno));