fix/TS-5251-add-conflict-check
This commit is contained in:
parent
c343f336fa
commit
3b23031a44
|
@ -1219,6 +1219,7 @@ static int32_t mndAlterDb(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pOld, SDbObj *p
|
||||||
|
|
||||||
mndTransSetDbName(pTrans, pOld->name, NULL);
|
mndTransSetDbName(pTrans, pOld->name, NULL);
|
||||||
TAOS_CHECK_GOTO(mndTransCheckConflict(pMnode, pTrans), NULL, _OVER);
|
TAOS_CHECK_GOTO(mndTransCheckConflict(pMnode, pTrans), NULL, _OVER);
|
||||||
|
TAOS_CHECK_GOTO(mndTransCheckConflictWithCompact(pMnode, pTrans), NULL, _OVER);
|
||||||
|
|
||||||
TAOS_CHECK_GOTO(mndSetAlterDbPrepareLogs(pMnode, pTrans, pOld, pNew), NULL, _OVER);
|
TAOS_CHECK_GOTO(mndSetAlterDbPrepareLogs(pMnode, pTrans, pOld, pNew), NULL, _OVER);
|
||||||
TAOS_CHECK_GOTO(mndSetAlterDbCommitLogs(pMnode, pTrans, pOld, pNew), NULL, _OVER);
|
TAOS_CHECK_GOTO(mndSetAlterDbCommitLogs(pMnode, pTrans, pOld, pNew), NULL, _OVER);
|
||||||
|
|
|
@ -867,6 +867,7 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) {
|
||||||
if (pIter == NULL) break;
|
if (pIter == NULL) break;
|
||||||
|
|
||||||
if (pNew->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
|
if (pNew->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
|
||||||
|
|
||||||
if (pNew->conflict == TRN_CONFLICT_DB) {
|
if (pNew->conflict == TRN_CONFLICT_DB) {
|
||||||
if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
|
if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
|
||||||
if (pTrans->conflict == TRN_CONFLICT_DB || pTrans->conflict == TRN_CONFLICT_DB_INSIDE) {
|
if (pTrans->conflict == TRN_CONFLICT_DB || pTrans->conflict == TRN_CONFLICT_DB_INSIDE) {
|
||||||
|
@ -874,6 +875,7 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) {
|
||||||
mndTransLogConflict(pNew, pTrans, mndCheckStbConflict(pNew->stbname, pTrans), &conflict);
|
mndTransLogConflict(pNew, pTrans, mndCheckStbConflict(pNew->stbname, pTrans), &conflict);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pNew->conflict == TRN_CONFLICT_DB_INSIDE) {
|
if (pNew->conflict == TRN_CONFLICT_DB_INSIDE) {
|
||||||
if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
|
if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
|
||||||
if (pTrans->conflict == TRN_CONFLICT_DB) {
|
if (pTrans->conflict == TRN_CONFLICT_DB) {
|
||||||
|
@ -885,22 +887,6 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (pNew->conflict == TRN_CONFLICT_TOPIC) {
|
|
||||||
// if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
|
|
||||||
// if (pTrans->conflict == TRN_CONFLICT_TOPIC || pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) {
|
|
||||||
// if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (pNew->conflict == TRN_CONFLICT_TOPIC_INSIDE) {
|
|
||||||
// if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
|
|
||||||
// if (pTrans->conflict == TRN_CONFLICT_TOPIC) {
|
|
||||||
// if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true;
|
|
||||||
// }
|
|
||||||
// if (pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) {
|
|
||||||
// if (strcasecmp(pNew->dbname, pTrans->dbname) == 0 && strcasecmp(pNew->stbname, pTrans->stbname) == 0)
|
|
||||||
// conflict = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
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) {
|
||||||
|
|
|
@ -3424,6 +3424,8 @@ static int32_t mndBalanceVgroup(SMnode *pMnode, SRpcMsg *pReq, SArray *pArray) {
|
||||||
}
|
}
|
||||||
mndTransSetSerial(pTrans);
|
mndTransSetSerial(pTrans);
|
||||||
mInfo("trans:%d, used to balance vgroup", pTrans->id);
|
mInfo("trans:%d, used to balance vgroup", pTrans->id);
|
||||||
|
TAOS_CHECK_GOTO(mndTransCheckConflict(pMnode, pTrans), NULL, _OVER);
|
||||||
|
TAOS_CHECK_GOTO(mndTransCheckConflictWithCompact(pMnode, pTrans), NULL, _OVER);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
taosArraySort(pArray, (__compar_fn_t)mndCompareDnodeVnodes);
|
taosArraySort(pArray, (__compar_fn_t)mndCompareDnodeVnodes);
|
||||||
|
|
Loading…
Reference in New Issue