TD-1887
This commit is contained in:
parent
07d901e164
commit
2e12e819f4
|
@ -310,6 +310,8 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
|
||||||
pVnode->version = walGetVersion(pVnode->wal);
|
pVnode->version = walGetVersion(pVnode->wal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
walRenew(pVnode->wal);
|
||||||
|
|
||||||
SSyncInfo syncInfo;
|
SSyncInfo syncInfo;
|
||||||
syncInfo.vgId = pVnode->vgId;
|
syncInfo.vgId = pVnode->vgId;
|
||||||
syncInfo.version = pVnode->version;
|
syncInfo.version = pVnode->version;
|
||||||
|
|
|
@ -145,18 +145,7 @@ static int32_t walInitObj(SWal *pWal) {
|
||||||
return TAOS_SYSTEM_ERROR(errno);
|
return TAOS_SYSTEM_ERROR(errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pWal->keep) {
|
wDebug("vgId:%d, object is initialized", pWal->vgId);
|
||||||
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);
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -264,8 +264,6 @@ static int32_t walRestoreWalFile(SWal *pWal, void *pVnode, FWalWrite writeFp, ch
|
||||||
wTrace("vgId:%d, fileId:%" PRId64 ", restore wal ver:%" PRIu64 ", head ver:%" PRIu64 " len:%d", pWal->vgId,
|
wTrace("vgId:%d, fileId:%" PRId64 ", restore wal ver:%" PRIu64 ", head ver:%" PRIu64 " len:%d", pWal->vgId,
|
||||||
pWal->fileId, pWal->version, pHead->version, pHead->len);
|
pWal->fileId, pWal->version, pHead->version, pHead->len);
|
||||||
|
|
||||||
if (pWal->keep) pWal->version = pHead->version;
|
|
||||||
|
|
||||||
(*writeFp)(pVnode, pHead, TAOS_QTYPE_WAL);
|
(*writeFp)(pVnode, pHead, TAOS_QTYPE_WAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue