minor changes
This commit is contained in:
parent
a24087b8d0
commit
de8b6e7351
|
@ -613,32 +613,14 @@ static int32_t mndSetUpdateDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
|
||||||
static int32_t mndUpdateDb(SMnode *pMnode, SMnodeMsg *pReq, SDbObj *pOld, SDbObj *pNew) {
|
static int32_t mndUpdateDb(SMnode *pMnode, SMnodeMsg *pReq, SDbObj *pOld, SDbObj *pNew) {
|
||||||
int32_t code = -1;
|
int32_t code = -1;
|
||||||
STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, &pReq->rpcMsg);
|
STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, &pReq->rpcMsg);
|
||||||
if (pTrans == NULL) {
|
if (pTrans == NULL) goto UPDATE_DB_OVER;
|
||||||
mError("db:%s, failed to update since %s", pOld->name, terrstr());
|
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
mDebug("trans:%d, used to update db:%s", pTrans->id, pOld->name);
|
mDebug("trans:%d, used to update db:%s", pTrans->id, pOld->name);
|
||||||
|
|
||||||
if (mndSetUpdateDbRedoLogs(pMnode, pTrans, pOld, pNew) != 0) {
|
if (mndSetUpdateDbRedoLogs(pMnode, pTrans, pOld, pNew) != 0) goto UPDATE_DB_OVER;
|
||||||
mError("trans:%d, failed to set redo log since %s", pTrans->id, terrstr());
|
if (mndSetUpdateDbCommitLogs(pMnode, pTrans, pOld, pNew) != 0) goto UPDATE_DB_OVER;
|
||||||
goto UPDATE_DB_OVER;
|
if (mndSetUpdateDbRedoActions(pMnode, pTrans, pOld, pNew) != 0) goto UPDATE_DB_OVER;
|
||||||
}
|
if (mndTransPrepare(pMnode, pTrans) != 0) goto UPDATE_DB_OVER;
|
||||||
|
|
||||||
if (mndSetUpdateDbCommitLogs(pMnode, pTrans, pOld, pNew) != 0) {
|
|
||||||
mError("trans:%d, failed to set commit log since %s", pTrans->id, terrstr());
|
|
||||||
goto UPDATE_DB_OVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mndSetUpdateDbRedoActions(pMnode, pTrans, pOld, pNew) != 0) {
|
|
||||||
mError("trans:%d, failed to set redo actions since %s", pTrans->id, terrstr());
|
|
||||||
goto UPDATE_DB_OVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mndTransPrepare(pMnode, pTrans) != 0) {
|
|
||||||
mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr());
|
|
||||||
goto UPDATE_DB_OVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
code = 0;
|
code = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue