diff --git a/source/dnode/mnode/impl/src/mndCluster.c b/source/dnode/mnode/impl/src/mndCluster.c index 7a3dde3cf3792de86d190b21f0c2a5df5a1b9502..70c93748210605cb13493b9f8ab11c8dc2e9793f 100644 --- a/source/dnode/mnode/impl/src/mndCluster.c +++ b/source/dnode/mnode/impl/src/mndCluster.c @@ -315,7 +315,7 @@ static int32_t mndProcessUptimeTimer(SRpcMsg *pReq) { return 0; } - mTrace("update cluster uptime to %" PRId64, clusterObj.upTime); + mInfo("update cluster uptime to %" PRId64, clusterObj.upTime); STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, pReq, "update-uptime"); if (pTrans == NULL) return -1; diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index e0dbc26122dae92cf371834cedeb83f4fc536036..e8172252a5475a11bc821b504d55d5b45b822dbc 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -176,6 +176,8 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) { SMqConsumerObj *pConsumer; void *pIter = NULL; + mTrace("start to process mq timer"); + // rebalance cannot be parallel if (!mndRebTryStart()) { mInfo("mq rebalance already in progress, do nothing"); diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index 5aad4af9ac49fff9ffb6f8b08aac0e5bdc3f6c8a..b945a2551cfb2d74e346de99ee2af73bba6121b4 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -119,28 +119,31 @@ static void *mndThreadFp(void *param) { lastTime++; taosMsleep(100); if (mndGetStop(pMnode)) break; + if (lastTime % 10 != 0) continue; - if (lastTime % (tsTtlPushInterval * 10) == 1) { + int64_t sec = lastTime / 10; + + if (sec % tsTtlPushInterval == 0) { mndPullupTtl(pMnode); } - if (lastTime % (tsTransPullupInterval * 10) == 0) { + if (sec % tsTransPullupInterval * 10 == 0) { mndPullupTrans(pMnode); } - if (lastTime % (tsMqRebalanceInterval * 10) == 0) { + if (sec % tsMqRebalanceInterval * 10 == 0) { mndCalMqRebalance(pMnode); } - if (lastTime % (tsTelemInterval * 10) == ((tsTelemInterval - 1) * 10)) { + if (sec % tsTelemInterval * 10 == (MIN(60, (tsTelemInterval - 1)))) { mndPullupTelem(pMnode); } - if (lastTime % (tsGrantHBInterval * 10) == 0) { + if (sec % tsGrantHBInterval == 0) { mndPullupGrant(pMnode); } - if ((lastTime % (tsUptimeInterval * 10)) == ((tsUptimeInterval - 1) * 10)) { + if (sec % tsUptimeInterval == 0) { mndIncreaseUpTime(pMnode); } } @@ -399,15 +402,15 @@ void mndPreClose(SMnode *pMnode) { atomic_store_8(&(pMnode->syncMgmt.leaderTransferFinish), 0); syncLeaderTransfer(pMnode->syncMgmt.sync); - /* - mInfo("vgId:1, mnode start leader transfer"); - // wait for leader transfer finish - while (!atomic_load_8(&(pMnode->syncMgmt.leaderTransferFinish))) { - taosMsleep(10); - mInfo("vgId:1, mnode waiting for leader transfer"); - } - mInfo("vgId:1, mnode finish leader transfer"); - */ +#if 0 + mInfo("vgId:1, mnode start leader transfer"); + // wait for leader transfer finish + while (!atomic_load_8(&(pMnode->syncMgmt.leaderTransferFinish))) { + taosMsleep(10); + mInfo("vgId:1, mnode waiting for leader transfer"); + } + mInfo("vgId:1, mnode finish leader transfer"); +#endif } } diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index e0b5bb1abf652dfd39f56b6100ad785ae3add516..02fd9f9679c567aba0b7bca7f49fe9d116b9480c 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -834,6 +834,8 @@ static int32_t mndProcessTtlTimer(SRpcMsg *pReq) { int32_t reqLen = tSerializeSVDropTtlTableReq(NULL, 0, &ttlReq); int32_t contLen = reqLen + sizeof(SMsgHead); + mInfo("start to process ttl timer"); + while (1) { pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); if (pIter == NULL) break; diff --git a/source/dnode/mnode/impl/src/mndTelem.c b/source/dnode/mnode/impl/src/mndTelem.c index 93f7531a272860d63351ff1a008fa11f48b5a17c..ff2461b63b41da33df1a6c2479ed8d58e963a484 100644 --- a/source/dnode/mnode/impl/src/mndTelem.c +++ b/source/dnode/mnode/impl/src/mndTelem.c @@ -133,7 +133,7 @@ static int32_t mndProcessTelemTimer(SRpcMsg* pReq) { if (taosSendHttpReport(tsTelemServer, tsTelemPort, pCont, strlen(pCont), HTTP_FLAT) != 0) { mError("failed to send telemetry report"); } else { - mTrace("succeed to send telemetry report"); + mInfo("succeed to send telemetry report"); } taosMemoryFree(pCont); } diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index b26fb160439390dc62b98a8f3ae29c8b961fc11f..cccd938e05190a3a36f9135c0bc1971caaa96e00 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -1478,6 +1478,7 @@ void mndTransExecute(SMnode *pMnode, STrans *pTrans) { } static int32_t mndProcessTransTimer(SRpcMsg *pReq) { + mTrace("start to process trans timer"); mndTransPullup(pReq->info.node); return 0; }