diff --git a/include/common/tglobal.h b/include/common/tglobal.h index b35b46021168ed38058f0bdd4a20742125d02204..86395c44da26a6a118367600e6e933a866268def 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -74,6 +74,9 @@ extern int32_t tsHeartbeatTimeout; // vnode extern int64_t tsVndCommitMaxIntervalMs; +// mnode +extern int64_t tsMndSdbWriteDelta; + // monitor extern bool tsEnableMonitor; extern int32_t tsMonitorInterval; diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index e7873fb2696064670114a8032c6f30483ca397b7..4bb64e5fd6dcee12a06c99228b707a3e2788da62 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -56,6 +56,7 @@ int32_t tsNumOfQnodeQueryThreads = 4; int32_t tsNumOfQnodeFetchThreads = 1; int32_t tsNumOfSnodeStreamThreads = 4; int32_t tsNumOfSnodeWriteThreads = 1; + // sync raft int32_t tsElectInterval = 25 * 1000; int32_t tsHeartbeatInterval = 1000; @@ -64,6 +65,9 @@ int32_t tsHeartbeatTimeout = 20 * 1000; // vnode int64_t tsVndCommitMaxIntervalMs = 600 * 1000; +// mnode +int64_t tsMndSdbWriteDelta = 2000; + // monitor bool tsEnableMonitor = true; int32_t tsMonitorInterval = 30; @@ -456,6 +460,8 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { if (cfgAddInt64(pCfg, "vndCommitMaxInterval", tsVndCommitMaxIntervalMs, 1000, 1000 * 60 * 60, 0) != 0) return -1; + if (cfgAddInt64(pCfg, "mndSdbWriteDelta", tsMndSdbWriteDelta, 20, 10000, 0) != 0) return -1; + if (cfgAddBool(pCfg, "monitor", tsEnableMonitor, 0) != 0) return -1; if (cfgAddInt32(pCfg, "monitorInterval", tsMonitorInterval, 1, 200000, 0) != 0) return -1; if (cfgAddString(pCfg, "monitorFqdn", tsMonitorFqdn, 0) != 0) return -1; @@ -801,6 +807,8 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsVndCommitMaxIntervalMs = cfgGetItem(pCfg, "vndCommitMaxInterval")->i64; + tsMndSdbWriteDelta = cfgGetItem(pCfg, "mndSdbWriteDelta")->i64; + tsStartUdfd = cfgGetItem(pCfg, "udf")->bval; tstrncpy(tsUdfdResFuncs, cfgGetItem(pCfg, "udfdResFuncs")->str, sizeof(tsUdfdResFuncs)); tstrncpy(tsUdfdLdLibPath, cfgGetItem(pCfg, "udfdLdLibPath")->str, sizeof(tsUdfdLdLibPath)); diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index edd75c62b9e879d2f127dcf7732365989fea7196..f702d8f14858f13525f893737f02cc40beab8355 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -123,7 +123,7 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta } } - sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA); + sdbWriteFile(pMnode->pSdb, tsMndSdbWriteDelta); return 0; } diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h index 1b7b2f96728e839ade05c615fe604bbebddb3b63..e9a9e425e3fd364a1702ca084edd8be4e0b4aeeb 100644 --- a/source/dnode/mnode/sdb/inc/sdb.h +++ b/source/dnode/mnode/sdb/inc/sdb.h @@ -37,8 +37,6 @@ extern "C" { #define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }} // clang-format on -#define SDB_WRITE_DELTA 2000 - #define SDB_GET_VAL(pData, dataPos, val, pos, func, type) \ { \ if (func(pRaw, dataPos, val) != 0) { \