diff --git a/src/balance/src/bnMain.c b/src/balance/src/bnMain.c index 25f316cb5e46025ff28f7364ce62a027505b57a4..67741b147328cca844b796399d599a7ad92c8a7b 100644 --- a/src/balance/src/bnMain.c +++ b/src/balance/src/bnMain.c @@ -220,10 +220,6 @@ int32_t bnAllocVnodes(SVgObj *pVgroup) { } static bool bnCheckVgroupReady(SVgObj *pVgroup, SVnodeGid *pRmVnode) { - if (pVgroup->lbTime + 5 * tsStatusInterval > tsAccessSquence) { - return false; - } - int32_t rmVnodeVer = 0; for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) { SVnodeGid *pVnode = pVgroup->vnodeGid + i; diff --git a/src/balance/src/bnThread.c b/src/balance/src/bnThread.c index b5043c19bb9e152ac7932060383bb527dff3c74b..44cb24effa09688db79bb9ae8fa40a381c0c0404 100644 --- a/src/balance/src/bnThread.c +++ b/src/balance/src/bnThread.c @@ -101,13 +101,13 @@ static void bnProcessTimer(void *handle, void *tmrId) { if (!sdbIsMaster()) return; if (tsBnThread.stop) return; + tsBnThread.timer = NULL; + bnStartTimer(-1); + bnCheckStatus(); + if (handle == NULL) { - tsBnThread.timer = NULL; ++tsAccessSquence; - bnStartTimer(-1); - bnCheckStatus(); - if (tsAccessSquence % tsBalanceInterval == 0) { mDebug("balance function is scheduled by timer"); bnPostSignal(); @@ -131,5 +131,5 @@ void bnStartTimer(int32_t mseconds) { } void bnNotify() { - bnStartTimer(10); + bnStartTimer(500); } diff --git a/src/mnode/src/mnodeDnode.c b/src/mnode/src/mnodeDnode.c index fb775d92d87390b7506ee29953c6f778b62148f3..70a63517cacfe25da58c3a1663b98beb8e5b7c4f 100644 --- a/src/mnode/src/mnodeDnode.c +++ b/src/mnode/src/mnodeDnode.c @@ -630,7 +630,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { } int32_t numOfMnodes = mnodeGetMnodesNum(); - if (numOfMnodes < tsNumOfMnodes && numOfMnodes < mnodeGetOnlineDnodesNum()) { + if (numOfMnodes < tsNumOfMnodes && numOfMnodes < mnodeGetOnlineDnodesNum() && !pDnode->isMgmt) { bnNotify(); }