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

more refact

上级 d08e5576
...@@ -193,12 +193,14 @@ int vnodeCommit(SVnode *pVnode) { ...@@ -193,12 +193,14 @@ int vnodeCommit(SVnode *pVnode) {
SVnodeInfo info; SVnodeInfo info;
char dir[TSDB_FILENAME_LEN]; char dir[TSDB_FILENAME_LEN];
vInfo("vgId:%d start to commit, version: %" PRId64, TD_VID(pVnode), pVnode->state.applied);
pVnode->onCommit = pVnode->inUse; pVnode->onCommit = pVnode->inUse;
pVnode->inUse = NULL; pVnode->inUse = NULL;
// save info // save info
info.config = pVnode->config; 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); snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pVnode->pTfs), TD_DIRSEP, pVnode->path);
if (vnodeSaveInfo(dir, &info) < 0) { if (vnodeSaveInfo(dir, &info) < 0) {
ASSERT(0); ASSERT(0);
...@@ -232,6 +234,8 @@ int vnodeCommit(SVnode *pVnode) { ...@@ -232,6 +234,8 @@ int vnodeCommit(SVnode *pVnode) {
pVnode->pPool = pVnode->onCommit; pVnode->pPool = pVnode->onCommit;
pVnode->onCommit = NULL; pVnode->onCommit = NULL;
vInfo("vgId:%d commit over", TD_VID(pVnode));
return 0; return 0;
} }
......
...@@ -138,6 +138,7 @@ int vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRpcMsg ...@@ -138,6 +138,7 @@ int vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRpcMsg
// commit if need // commit if need
if (vnodeShouldCommit(pVnode)) { if (vnodeShouldCommit(pVnode)) {
vInfo("vgId:%d commit at version %" PRId64, TD_VID(pVnode), version);
// commit current change // commit current change
vnodeCommit(pVnode); vnodeCommit(pVnode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册