diff --git a/include/common/tglobal.h b/include/common/tglobal.h index da5158abb562c4236282f689b61cf38be2337e85..97e6491b987370c58181d00d0ce948f897d3fa24 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -121,6 +121,9 @@ extern char tsCompressor[]; extern int32_t tsDiskCfgNum; extern SDiskCfg tsDiskCfg[]; +// udf +extern bool tsStartUdfd; + // internal extern int32_t tsTransPullupInterval; extern int32_t tsMqRebalanceInterval; diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index c8781097114f12654c2fbef32908d86bc51c81f6..f017d22b390b2d743cb90e9f70e2da4bd82af0f4 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -169,6 +169,9 @@ uint32_t tsMaxRange = 500; // max range uint32_t tsCurRange = 100; // range char tsCompressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESSOR +// udf +bool tsStartUdfd = true; + // internal int32_t tsTransPullupInterval = 6; int32_t tsMqRebalanceInterval = 2; @@ -441,6 +444,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { if (cfgAddInt32(pCfg, "transPullupInterval", tsTransPullupInterval, 1, 10000, 1) != 0) return -1; if (cfgAddInt32(pCfg, "mqRebalanceInterval", tsMqRebalanceInterval, 1, 10000, 1) != 0) return -1; + if (cfgAddBool(pCfg, "startUdfd", tsStartUdfd, 0) != 0) return -1; return 0; } @@ -581,6 +585,8 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsTransPullupInterval = cfgGetItem(pCfg, "transPullupInterval")->i32; tsMqRebalanceInterval = cfgGetItem(pCfg, "mqRebalanceInterval")->i32; + tsStartUdfd = cfgGetItem(pCfg, "startUdfd")->bval; + if (tsQueryBufferSize >= 0) { tsQueryBufferSizeBytes = tsQueryBufferSize * 1048576UL; } diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index 11502b4c477b2363253105bd7524954297cde4ce..3dae7845e6009ea746bffc2a73e987e21ec7b320 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -18,6 +18,7 @@ #include "tudf.h" #include "tudfInt.h" #include "tarray.h" +#include "tglobal.h" #include "tdatablock.h" #include "querynodes.h" #include "builtinsimpl.h" @@ -138,6 +139,9 @@ static void udfWatchUdfd(void *args) { } int32_t udfStartUdfd(int32_t startDnodeId) { + if (!tsStartUdfd) { + fnInfo("start udfd is disabled.") + } SUdfdData *pData = &udfdGlobal; if (pData->startCalled) { fnInfo("dnode-mgmt start udfd already called");