fix/TS-5251-add-conflict-check-add-case

This commit is contained in:
dmchen 2024-11-26 10:04:13 +08:00
parent ad55bb7a85
commit 6c820cc79c
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -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!")