more refact
This commit is contained in:
parent
d08e55762f
commit
98fc272ac8
|
@ -193,12 +193,14 @@ int vnodeCommit(SVnode *pVnode) {
|
|||
SVnodeInfo info;
|
||||
char dir[TSDB_FILENAME_LEN];
|
||||
|
||||
vInfo("vgId:%d start to commit, version: %" PRId64, TD_VID(pVnode), pVnode->state.applied);
|
||||
|
||||
pVnode->onCommit = pVnode->inUse;
|
||||
pVnode->inUse = NULL;
|
||||
|
||||
// save info
|
||||
info.config = pVnode->config;
|
||||
info.state.committed = pVnode->state.processed;
|
||||
info.state.committed = pVnode->state.applied;
|
||||
snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pVnode->pTfs), TD_DIRSEP, pVnode->path);
|
||||
if (vnodeSaveInfo(dir, &info) < 0) {
|
||||
ASSERT(0);
|
||||
|
@ -232,6 +234,8 @@ int vnodeCommit(SVnode *pVnode) {
|
|||
pVnode->pPool = pVnode->onCommit;
|
||||
pVnode->onCommit = NULL;
|
||||
|
||||
vInfo("vgId:%d commit over", TD_VID(pVnode));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,6 +138,7 @@ int vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRpcMsg
|
|||
|
||||
// commit if need
|
||||
if (vnodeShouldCommit(pVnode)) {
|
||||
vInfo("vgId:%d commit at version %" PRId64, TD_VID(pVnode), version);
|
||||
// commit current change
|
||||
vnodeCommit(pVnode);
|
||||
|
||||
|
|
Loading…
Reference in New Issue