enh: save sdb file if there is too many commit

This commit is contained in:
Shengliang Guan 2022-05-28 17:10:29 +08:00
parent 147c7ee0b4
commit c4c1ce9b9e
1 changed files with 4 additions and 0 deletions

View File

@ -48,6 +48,10 @@ void mndSyncCommitMsg(struct SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta cbM
mError("trans:%d, failed to propose since %s", transId, tstrerror(pMgmt->errCode)); mError("trans:%d, failed to propose since %s", transId, tstrerror(pMgmt->errCode));
} }
tsem_post(&pMgmt->syncSem); tsem_post(&pMgmt->syncSem);
} else {
if (cbMeta.index - sdbGetApplyIndex(pMnode->pSdb) > 100) {
sdbWriteFile(pMnode->pSdb);
}
} }
} }