add tsma creation/dropping trx conflict check
This commit is contained in:
parent
3312eec628
commit
856cc32f39
|
@ -106,6 +106,7 @@ typedef enum {
|
|||
// TRN_CONFLICT_TOPIC = 4,
|
||||
// TRN_CONFLICT_TOPIC_INSIDE = 5,
|
||||
TRN_CONFLICT_ARBGROUP = 6,
|
||||
TRN_CONFLICT_TSMA = 7,
|
||||
} ETrnConflct;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -1692,7 +1692,7 @@ static int32_t mndCreateTSMATxnPrepare(SCreateTSMACxt* pCxt) {
|
|||
STransAction dropStbUndoAction = {0};
|
||||
SMDropStbReq dropStbReq = {0};
|
||||
STrans *pTrans =
|
||||
mndTransCreate(pCxt->pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, pCxt->pRpcReq, "create-tsma");
|
||||
mndTransCreate(pCxt->pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TSMA, pCxt->pRpcReq, "create-tsma");
|
||||
if (!pTrans) {
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
|
@ -1974,7 +1974,7 @@ _OVER:
|
|||
static int32_t mndDropTSMA(SCreateTSMACxt* pCxt) {
|
||||
int32_t code = -1;
|
||||
STransAction dropStreamRedoAction = {0};
|
||||
STrans *pTrans = mndTransCreate(pCxt->pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, pCxt->pRpcReq, "drop-tsma");
|
||||
STrans *pTrans = mndTransCreate(pCxt->pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_TSMA, pCxt->pRpcReq, "drop-tsma");
|
||||
if (!pTrans) {
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
|
|
|
@ -902,6 +902,14 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) {
|
|||
}
|
||||
}
|
||||
|
||||
if (pNew->conflict == TRN_CONFLICT_TSMA) {
|
||||
if (pTrans->conflict == TRN_CONFLICT_GLOBAL || pTrans->conflict == TRN_CONFLICT_TSMA) {
|
||||
mndTransLogConflict(pNew, pTrans, true, &conflict);
|
||||
} else {
|
||||
mndTransLogConflict(pNew, pTrans, false, &conflict);
|
||||
}
|
||||
}
|
||||
|
||||
sdbRelease(pMnode->pSdb, pTrans);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue