fix: align firstVer with lastVer too if no WAL logs exist
This commit is contained in:
parent
b80095dc87
commit
95f8e96eb5
|
@ -285,6 +285,9 @@ void walAlignVersions(SWal* pWal) {
|
||||||
if (pWal->vers.lastVer < pWal->vers.snapshotVer) {
|
if (pWal->vers.lastVer < pWal->vers.snapshotVer) {
|
||||||
wWarn("vgId:%d, lastVer:%" PRId64 " is less than snapshotVer:%" PRId64 ". align with it.", pWal->cfg.vgId,
|
wWarn("vgId:%d, lastVer:%" PRId64 " is less than snapshotVer:%" PRId64 ". align with it.", pWal->cfg.vgId,
|
||||||
pWal->vers.lastVer, pWal->vers.snapshotVer);
|
pWal->vers.lastVer, pWal->vers.snapshotVer);
|
||||||
|
if (pWal->vers.lastVer < pWal->vers.firstVer) {
|
||||||
|
pWal->vers.firstVer = pWal->vers.snapshotVer + 1;
|
||||||
|
}
|
||||||
pWal->vers.lastVer = pWal->vers.snapshotVer;
|
pWal->vers.lastVer = pWal->vers.snapshotVer;
|
||||||
}
|
}
|
||||||
if (pWal->vers.commitVer < pWal->vers.snapshotVer) {
|
if (pWal->vers.commitVer < pWal->vers.snapshotVer) {
|
||||||
|
|
Loading…
Reference in New Issue