fix: use pInfo->info.state.committed instead of the current one for async vnodeCommit
This commit is contained in:
parent
45cfcdc047
commit
90830e5410
|
@ -294,7 +294,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) {
|
||||||
SVnode *pVnode = pInfo->pVnode;
|
SVnode *pVnode = pInfo->pVnode;
|
||||||
|
|
||||||
vInfo("vgId:%d, start to commit, commitId:%" PRId64 " version:%" PRId64 " term: %" PRId64, TD_VID(pVnode),
|
vInfo("vgId:%d, start to commit, commitId:%" PRId64 " version:%" PRId64 " term: %" PRId64, TD_VID(pVnode),
|
||||||
pVnode->state.commitID, pVnode->state.applied, pVnode->state.applyTerm);
|
pInfo->info.state.commitID, pInfo->info.state.committed, pVnode->state.commitTerm);
|
||||||
|
|
||||||
// persist wal before starting
|
// persist wal before starting
|
||||||
if (walPersist(pVnode->pWal) < 0) {
|
if (walPersist(pVnode->pWal) < 0) {
|
||||||
|
@ -308,8 +308,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) {
|
||||||
snprintf(dir, TSDB_FILENAME_LEN, "%s", pVnode->path);
|
snprintf(dir, TSDB_FILENAME_LEN, "%s", pVnode->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// walBeginSnapshot(pVnode->pWal, pVnode->state.applied);
|
syncBeginSnapshot(pVnode->sync, pInfo->info.state.committed);
|
||||||
syncBeginSnapshot(pVnode->sync, pVnode->state.applied);
|
|
||||||
|
|
||||||
// commit each sub-system
|
// commit each sub-system
|
||||||
code = tsdbCommit(pVnode->pTsdb, pInfo);
|
code = tsdbCommit(pVnode->pTsdb, pInfo);
|
||||||
|
@ -351,7 +350,6 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// walEndSnapshot(pVnode->pWal);
|
|
||||||
syncEndSnapshot(pVnode->sync);
|
syncEndSnapshot(pVnode->sync);
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
|
|
Loading…
Reference in New Issue