balance: remove unused pVgroup->lbTime checking

This commit is contained in:
Minglei Jin 2021-06-10 13:32:42 +08:00
parent 935d41b1f7
commit b0fb8f9dc6
3 changed files with 7 additions and 11 deletions

View File

@ -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;

View File

@ -101,12 +101,12 @@ static void bnProcessTimer(void *handle, void *tmrId) {
if (!sdbIsMaster()) return;
if (tsBnThread.stop) return;
if (handle == NULL) {
tsBnThread.timer = NULL;
++tsAccessSquence;
tsBnThread.timer = NULL;
bnStartTimer(-1);
bnCheckStatus();
bnStartTimer(-1);
bnCheckStatus();
if (handle == NULL) {
++tsAccessSquence;
if (tsAccessSquence % tsBalanceInterval == 0) {
mDebug("balance function is scheduled by timer");
@ -131,5 +131,5 @@ void bnStartTimer(int32_t mseconds) {
}
void bnNotify() {
bnStartTimer(10);
bnStartTimer(500);
}

View File

@ -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();
}