From 14519019f712c7b101c1509bde8640e2964c19e5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 27 Oct 2022 11:10:54 +0800 Subject: [PATCH] enh: balance vgroup --- source/dnode/mnode/impl/src/mndVgroup.c | 4 ---- source/libs/sync/src/syncMain.c | 4 ++-- tests/script/jenkins/basic.txt | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 23397cedc6..694a781439 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1890,9 +1890,6 @@ _OVER: } static int32_t mndProcessBalanceVgroupMsg(SRpcMsg *pReq) { -#if 1 - return TSDB_CODE_OPS_NOT_SUPPORT; -#else SMnode *pMnode = pReq->info.node; int32_t code = -1; SArray *pArray = NULL; @@ -1941,7 +1938,6 @@ _OVER: taosArrayDestroy(pArray); return code; -#endif } bool mndVgroupInDb(SVgObj *pVgroup, int64_t dbUid) { return !pVgroup->isTsma && pVgroup->dbUid == dbUid; } diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index f1c900de50..c0039ce39f 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -1148,6 +1148,8 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { pSyncNode->pRaftCfg = NULL; } + // init by SSyncInfo + pSyncNode->vgId = pSyncInfo->vgId; SSyncCfg* pCfg = &pSyncInfo->syncCfg; sDebug("vgId:%d, replica:%d selfIndex:%d", pSyncNode->vgId, pCfg->replicaNum, pCfg->myIndex); for (int32_t i = 0; i < pCfg->replicaNum; ++i) { @@ -1155,8 +1157,6 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { sDebug("vgId:%d, index:%d ep:%s:%u", pSyncNode->vgId, i, pNode->nodeFqdn, pNode->nodePort); } - // init by SSyncInfo - pSyncNode->vgId = pSyncInfo->vgId; memcpy(pSyncNode->path, pSyncInfo->path, sizeof(pSyncNode->path)); snprintf(pSyncNode->raftStorePath, sizeof(pSyncNode->raftStorePath), "%s%sraft_store.json", pSyncInfo->path, TD_DIRSEP); diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 26162579c1..5b0df2702e 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -36,8 +36,8 @@ ./test.sh -f tsim/db/taosdlog.sim # ---- dnode -# unsupport ./test.sh -f tsim/dnode/balance_replica1.sim -# unsupport ./test.sh -f tsim/dnode/balance_replica3.sim +./test.sh -f tsim/dnode/balance_replica1.sim +./test.sh -f tsim/dnode/balance_replica3.sim # unsupport ./test.sh -f tsim/dnode/balance1.sim # unsupport ./test.sh -f tsim/dnode/balance2.sim # unsupport ./test.sh -f tsim/dnode/balance3.sim -- GitLab