enh: refact syncMsg code

This commit is contained in:
Shengliang Guan 2022-11-01 18:34:09 +08:00
parent ee63b49800
commit 64633e3dbb
2 changed files with 4 additions and 4 deletions

View File

@ -234,7 +234,7 @@ int32_t mndInitSync(SMnode *pMnode) {
.batchSize = 1,
.vgId = 1,
.pWal = pMnode->pWal,
.msgcb = NULL,
.msgcb = &pMnode->msgCb,
.syncSendMSg = mndSyncSendMsg,
.syncEqMsg = mndSyncEqMsg,
.syncEqCtrlMsg = mndSyncEqCtrlMsg,

View File

@ -325,13 +325,13 @@ static void vnodeSyncApplyMsg(const SSyncFSM *pFsm, const SRpcMsg *pMsg, const S
static void vnodeSyncCommitMsg(const SSyncFSM *pFsm, const SRpcMsg *pMsg, const SFsmCbMeta *pMeta) {
if (pMeta->isWeak == 0) {
vnodeSyncApplyMsg(pFsm->data, pMsg, pMeta);
vnodeSyncApplyMsg(pFsm, pMsg, pMeta);
}
}
static void vnodeSyncPreCommitMsg(const SSyncFSM *pFsm, const SRpcMsg *pMsg, const SFsmCbMeta *pMeta) {
if (pMeta->isWeak == 1) {
vnodeSyncApplyMsg(pFsm->data, pMsg, pMeta);
vnodeSyncApplyMsg(pFsm, pMsg, pMeta);
}
}
@ -514,7 +514,7 @@ int32_t vnodeSyncOpen(SVnode *pVnode, char *path) {
.vgId = pVnode->config.vgId,
.syncCfg = pVnode->config.syncCfg,
.pWal = pVnode->pWal,
.msgcb = NULL,
.msgcb = &pVnode->msgCb,
.syncSendMSg = vnodeSyncSendMsg,
.syncEqMsg = vnodeSyncEqMsg,
.syncEqCtrlMsg = vnodeSyncEqCtrlMsg,