提交 ebc7b71d 编写于 作者: C Cary Xu

logic optimization

上级 321074a0
...@@ -550,13 +550,14 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) { ...@@ -550,13 +550,14 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) {
} }
if (status == TSDB_STATUS_COMMIT_OVER) { if (status == TSDB_STATUS_COMMIT_OVER) {
pVnode->isCommiting = 0;
pVnode->isFull = 0; pVnode->isFull = 0;
pVnode->fversion = pVnode->cversion; pVnode->fversion = pVnode->cversion;
vInfo("vgId:%d, commit over, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version); vInfo("vgId:%d, commit over, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version);
if (!vnodeInInitStatus(pVnode)) { if (!vnodeInInitStatus(pVnode)) {
walRemoveOneOldFile(pVnode->wal); walRemoveOneOldFile(pVnode->wal);
} }
// vnodeGetVersion() and calling tsdbSetWalSize() would reply on the vnode isCommiting state
pVnode->isCommiting = 0;
return vnodeSaveVersion(pVnode); return vnodeSaveVersion(pVnode);
} }
......
...@@ -176,7 +176,9 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe ...@@ -176,7 +176,9 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
return terrno; return terrno;
} }
if ((pVnode->version & 8191) == 0) { // no need to set wal size to trigger commit if vnode in committing state
// TODO: retrieve pVnode->isCommiting need atomic operation?
if (((pVnode->version & 8191) == 0) && (pVnode->isCommiting == 0)) {
tsdbSetWalSize(pVnode->tsdb, walGetFSize(pVnode->wal) >> 20); tsdbSetWalSize(pVnode->tsdb, walGetFSize(pVnode->wal) >> 20);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册