fix: not allow to rollback WAL across snapshot point

This commit is contained in:
benguang.zhao 2022-10-31 21:06:08 +08:00
parent 31a0421878
commit 1d0eae197d
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ int32_t walRollback(SWal *pWal, int64_t ver) {
taosThreadMutexLock(&pWal->mutex);
int64_t code;
char fnameStr[WAL_FILE_LEN];
if (ver > pWal->vers.lastVer || ver < pWal->vers.commitVer) {
if (ver > pWal->vers.lastVer || ver < pWal->vers.commitVer || ver <= pWal->vers.snapshotVer) {
terrno = TSDB_CODE_WAL_INVALID_VER;
taosThreadMutexUnlock(&pWal->mutex);
return -1;