未验证 提交 290e3cb5 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #4076 from taosdata/feature/wal

TD-1887]
......@@ -310,6 +310,8 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
pVnode->version = walGetVersion(pVnode->wal);
}
walRenew(pVnode->wal);
SSyncInfo syncInfo;
syncInfo.vgId = pVnode->vgId;
syncInfo.version = pVnode->version;
......
......@@ -145,18 +145,7 @@ static int32_t walInitObj(SWal *pWal) {
return TAOS_SYSTEM_ERROR(errno);
}
if (pWal->keep) {
return TSDB_CODE_SUCCESS;
}
walRenew(pWal);
if (pWal && pWal->fd < 0) {
wError("vgId:%d, file:%s, failed to open file since %s", pWal->vgId, pWal->path, strerror(errno));
return TAOS_SYSTEM_ERROR(errno);
}
wDebug("vgId:%d, file is initialized", pWal->vgId);
wDebug("vgId:%d, object is initialized", pWal->vgId);
return TSDB_CODE_SUCCESS;
}
......
......@@ -80,6 +80,7 @@ int32_t walWrite(void *handle, SWalHead *pHead) {
int32_t code = 0;
// no wal
if (pWal->fd <= 0) return 0;
if (pWal->level == TAOS_WAL_NOLOG) return 0;
if (pHead->version <= pWal->version) return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册