fix(tsdb): fix invalid empty time window check.

This commit is contained in:
Haojun Liao 2024-04-12 17:52:52 +08:00
parent 6127185e3b
commit cf30db8795
2 changed files with 7 additions and 3 deletions

View File

@ -419,6 +419,8 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl
tValueDupPayload(&vLast);
taosArrayPush(pBlockLoadInfo->info.pLastKey, &vLast);
}
ASSERT(taosArrayGetSize(pBlockLoadInfo->info.pLastKey) == taosArrayGetSize(pBlockLoadInfo->info.pFirstTs));
}
} else {
@ -450,6 +452,8 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl
i += 1;
}
ASSERT(taosArrayGetSize(pBlockLoadInfo->info.pLastKey) == taosArrayGetSize(pBlockLoadInfo->info.pFirstTs));
}
}
}

View File

@ -728,7 +728,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
STableBlockScanInfo* pScanInfo = getTableBlockScanInfo(pReader->status.pTableMap, uid, pReader->idStr);
// todo: here we should find the first timestamp that is greater than the lastProcKey
// here we should find the first timestamp that is greater than the lastProcKey
// the window is an open interval NOW.
if (asc) {
w.skey = pScanInfo->lastProcKey.ts;
@ -736,9 +736,9 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
w.ekey = pScanInfo->lastProcKey.ts;
}
if (/*isEmptyQueryTimeWindow(&w)*/ w.ekey - w.skey < 1) { // NOTE: specialized for open interval
// NOTE: specialized for open interval
if (((w.skey < INT64_MAX) && ((w.skey + 1) > w.ekey)) || (w.skey == INT64_MAX)) {
k += 1;
if (k >= numOfTables) {
break;
} else {