提交 98fc272a 编写于 作者: H Hongze Cheng

more refact

上级 d08e5576
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册