diff --git a/source/libs/index/src/index.c b/source/libs/index/src/index.c index 1faf1decb45cd5b78a856fd116aa8f91534aa1bc..d60bde718d958800580e17fcf92c47e4a1050926 100644 --- a/source/libs/index/src/index.c +++ b/source/libs/index/src/index.c @@ -565,7 +565,7 @@ static int64_t indexGetAvaialbleVer(SIndex* sIdx, IndexCache* cache) { taosThreadMutexUnlock(&tf->mtx); if (rd != NULL) { - ver += MAX(ver, rd->header.version) + 1; + ver = (ver > rd->header.version ? ver : rd->header.verion) + 1; indexInfo("header: %" PRId64 ", ver: %" PRId64 "", rd->header.version, ver); } tfileReaderUnRef(rd);