Merge pull request #17824 from taosdata/FIX/TS-1984-3.0

fix: set firstTrial as false if error encountered in loop of walScanLogGetLastVer
This commit is contained in:
Shengliang Guan 2022-11-02 15:49:48 +08:00 committed by GitHub
commit 77a6cf503e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -201,7 +201,13 @@ static FORCE_INLINE int64_t walScanLogGetLastVer(SWal* pWal, int32_t fileIdx) {
}
if (end == fileSize) firstTrial = false;
if (firstTrial && terrno == TSDB_CODE_SUCCESS) continue;
if (firstTrial) {
if (terrno == TSDB_CODE_SUCCESS) {
continue;
} else {
firstTrial = false;
}
}
if (retVer >= 0 || offset == 0) break;
}