fix(tsdb): add return flag for stt files.

This commit is contained in:
Haojun Liao 2023-12-08 11:07:45 +08:00
parent 2e13b0b97d
commit da1207ef74
2 changed files with 3 additions and 1 deletions

View File

@ -2069,7 +2069,7 @@ static bool initSttBlockReader(SSttBlockReader* pSttBlockReader, STableBlockScan
// second time init stt block reader
if (pScanInfo->cleanSttBlocks && pReader->info.execMode == READER_EXEC_ROWS) {
return true;
return !pScanInfo->sttBlockReturned;
}
STimeWindow w = pSttBlockReader->window;
@ -2710,6 +2710,7 @@ static int32_t doLoadSttBlockSequentially(STsdbReader* pReader) {
pScanInfo->lastProcKey =
ASCENDING_TRAVERSE(pReader->info.order) ? pScanInfo->sttWindow.ekey : pScanInfo->sttWindow.skey;
pSttBlockReader->mergeTree.pIter = NULL;
pScanInfo->sttBlockReturned = true;
tsdbDebug("%p uid:%" PRId64 " return clean stt block as one, brange:%" PRId64 "-%" PRId64 " rows:%" PRId64 " %s",
pReader, pResBlock->info.id.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey,

View File

@ -94,6 +94,7 @@ typedef struct STableBlockScanInfo {
int32_t sttBlockDelIndex; // delete index for last block
bool iterInit; // whether to initialize the in-memory skip list iterator or not
bool cleanSttBlocks; // stt block is clean in current fileset
bool sttBlockReturned; // result block returned alreay
int64_t numOfRowsInStt;
STimeWindow sttWindow;
} STableBlockScanInfo;