Merge pull request #26368 from taosdata/fix/TD-30853-3.0

fix: mndCheckTransConflict uses the same iterator variable
This commit is contained in:
Hongze Cheng 2024-07-04 14:25:50 +08:00 committed by GitHub
commit 8d449140bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -855,15 +855,15 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) {
if (pNew->conflict == TRN_CONFLICT_ARBGROUP) { if (pNew->conflict == TRN_CONFLICT_ARBGROUP) {
if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true; if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
if (pTrans->conflict == TRN_CONFLICT_ARBGROUP) { if (pTrans->conflict == TRN_CONFLICT_ARBGROUP) {
pIter = taosHashIterate(pNew->arbGroupIds, NULL); void* pGidIter = taosHashIterate(pNew->arbGroupIds, NULL);
while (pIter != NULL) { while (pGidIter != NULL) {
int32_t groupId = *(int32_t *)pIter; int32_t groupId = *(int32_t *)pGidIter;
if (taosHashGet(pTrans->arbGroupIds, &groupId, sizeof(int32_t)) != NULL) { if (taosHashGet(pTrans->arbGroupIds, &groupId, sizeof(int32_t)) != NULL) {
taosHashCancelIterate(pNew->arbGroupIds, pIter); taosHashCancelIterate(pNew->arbGroupIds, pGidIter);
conflict = true; conflict = true;
break; break;
} }
pIter = taosHashIterate(pNew->arbGroupIds, pIter); pGidIter = taosHashIterate(pNew->arbGroupIds, pGidIter);
} }
} }
} }