From 6c820cc79cf5db6263aba832e19be016c218830b Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 26 Nov 2024 10:04:13 +0800 Subject: [PATCH] fix/TS-5251-add-conflict-check-add-case --- source/dnode/mnode/impl/src/mndVgroup.c | 1 + tests/system-test/6-cluster/compactDBConflict.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 544db76a49..01dedd4762 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -3193,6 +3193,7 @@ int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgro mInfo("trans:%d, used to split vgroup, vgId:%d", pTrans->id, pVgroup->vgId); mndTransSetDbName(pTrans, pDb->name, NULL); + TAOS_CHECK_GOTO(mndTransCheckConflictWithCompact(pMnode, pTrans), NULL, _OVER); SVgObj newVg1 = {0}; memcpy(&newVg1, pVgroup, sizeof(SVgObj)); diff --git a/tests/system-test/6-cluster/compactDBConflict.py b/tests/system-test/6-cluster/compactDBConflict.py index 62ddd99585..54d1513ad0 100644 --- a/tests/system-test/6-cluster/compactDBConflict.py +++ b/tests/system-test/6-cluster/compactDBConflict.py @@ -36,7 +36,7 @@ class TDTestCase: newTdSql=tdCom.newTdSql() t0 = threading.Thread(target=self.compactDBThread, args=('', event, newTdSql)) t0.start() - tdLog.info("t0 threading started,wait compact db tran finish") + tdLog.info("t0 threading started,wait compact db tran start") event.wait() tdSql.error('ALTER DATABASE db REPLICA 3;', expectErrInfo="Transaction not completed due to conflict with compact") tdLog.info("wait compact db finish") @@ -47,7 +47,7 @@ class TDTestCase: newTdSql1=tdCom.newTdSql() t1 = threading.Thread(target=self.compactDBThread, args=('', event1, newTdSql1)) t1.start() - tdLog.info("t1 threading started,wait compact db tran finish") + tdLog.info("t1 threading started,wait compact db tran start") event1.wait() tdSql.error('REDISTRIBUTE VGROUP 5 DNODE 1;', expectErrInfo="Transaction not completed due to conflict with compact") tdLog.info("wait compact db finish") @@ -58,12 +58,12 @@ class TDTestCase: newTdSql2=tdCom.newTdSql() t2 = threading.Thread(target=self.compactDBThread, args=('', event2, newTdSql2)) t2.start() - tdLog.info("t2 threading started,wait compact db tran finish") + tdLog.info("t2 threading started,wait compact db tran start") event2.wait() rowLen = tdSql.query('show vgroups') if rowLen > 0: vgroupId = tdSql.getData(0, 0) - tdLog.info(f"splitVgroupThread vgroupId:{vgroupId} start") + tdLog.info(f"split Vgroup vgroupId:{vgroupId} start") tdSql.error(f"split vgroup {vgroupId}", expectErrInfo="Transaction not completed due to conflict with compact") else: tdLog.exit("get vgroupId fail!")