fix(tsdb): reset the stt reader for new files.

This commit is contained in:
Haojun Liao 2023-06-21 14:46:35 +08:00
parent f6e3ad27f0
commit 6261359efe
1 changed files with 7 additions and 2 deletions

View File

@ -595,6 +595,8 @@ static int32_t filesetIteratorNext(SFilesetIter* pIter, STsdbReader* pReader, bo
pIter->pLastBlockReader->uid = 0; pIter->pLastBlockReader->uid = 0;
tMergeTreeClose(&pIter->pLastBlockReader->mergeTree); tMergeTreeClose(&pIter->pLastBlockReader->mergeTree);
destroySttBlockReader(pReader->status.pLDataIter, pReader->pTsdb->pVnode->config.sttTrigger);
resetLastBlockLoadInfo(pIter->pLastBlockReader->pInfo); resetLastBlockLoadInfo(pIter->pLastBlockReader->pInfo);
// check file the time range of coverage // check file the time range of coverage
@ -1019,9 +1021,8 @@ static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SBlockN
} }
{ {
while (record.uid > uid) { while (record.uid > uid && (k + 1) < numOfTables) {
k += 1; k += 1;
uid = pReader->status.uidList.tableUidList[k]; uid = pReader->status.uidList.tableUidList[k];
pScanInfo = getTableBlockScanInfo(pReader->status.pTableMap, uid, pReader->idStr); pScanInfo = getTableBlockScanInfo(pReader->status.pTableMap, uid, pReader->idStr);
@ -1032,6 +1033,10 @@ static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SBlockN
} }
} }
if (k >= numOfTables) {
break;
}
if (record.uid < uid) { if (record.uid < uid) {
continue; continue;
} }