fix: set trans from rollback to undo if mnode not leader
This commit is contained in:
parent
81913fcb80
commit
ff70b102fa
|
@ -598,7 +598,7 @@ static int32_t mndTransActionUpdate(SSdb *pSdb, STrans *pOld, STrans *pNew) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pOld->stage == TRN_STAGE_ROLLBACK) {
|
if (pOld->stage == TRN_STAGE_ROLLBACK) {
|
||||||
pOld->stage = TRN_STAGE_REDO_ACTION;
|
pOld->stage = TRN_STAGE_UNDO_ACTION;
|
||||||
mTrace("trans:%d, stage from rollback to undoAction since perform update action", pNew->id);
|
mTrace("trans:%d, stage from rollback to undoAction since perform update action", pNew->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,7 @@ static int32_t sdbInsertRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow *
|
||||||
if (insertFp != NULL) {
|
if (insertFp != NULL) {
|
||||||
code = (*insertFp)(pSdb, pRow->pObj);
|
code = (*insertFp)(pSdb, pRow->pObj);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
|
if (terrno == 0) terrno = TSDB_CODE_MND_TRANS_UNKNOW_ERROR;
|
||||||
code = terrno;
|
code = terrno;
|
||||||
taosHashRemove(hash, pRow->pObj, keySize);
|
taosHashRemove(hash, pRow->pObj, keySize);
|
||||||
sdbFreeRow(pSdb, pRow, false);
|
sdbFreeRow(pSdb, pRow, false);
|
||||||
|
|
Loading…
Reference in New Issue