tsdbCache/delete: load delete data only del file exists

This commit is contained in:
Minglei Jin 2022-06-28 15:59:54 +08:00
parent b5125afd79
commit d3e741a84e
1 changed files with 17 additions and 13 deletions

View File

@ -595,23 +595,27 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
*ppRow = NULL;
SDelFReader *pDelFReader;
SDelFile *pDelFile = tsdbFSStateGetDelFile(pTsdb->fs->cState);
code = tsdbDelFReaderOpen(&pDelFReader, pDelFile, pTsdb, NULL);
if (code) goto _err;
SDelIdx delIdx;
code = getTableDelIdx(pDelFReader, suid, uid, &delIdx);
if (code) goto _err;
SArray *pSkyline = taosArrayInit(32, sizeof(TSDBKEY));
code = getTableDelSkyline(pMem, pIMem, pDelFReader, &delIdx, pSkyline);
if (code) goto _err;
SDelFile *pDelFile = tsdbFSStateGetDelFile(pTsdb->fs->cState);
if (pDelFile) {
SDelFReader *pDelFReader;
code = tsdbDelFReaderOpen(&pDelFReader, pDelFile, pTsdb, NULL);
if (code) goto _err;
SDelIdx delIdx;
code = getTableDelIdx(pDelFReader, suid, uid, &delIdx);
if (code) goto _err;
code = getTableDelSkyline(pMem, pIMem, pDelFReader, &delIdx, pSkyline);
if (code) goto _err;
tsdbDelFReaderClose(pDelFReader);
}
int iSkyline = taosArrayGetSize(pSkyline) - 1;
tsdbDelFReaderClose(pDelFReader);
SBlockIdx idx = {.suid = suid, .uid = uid};
SFSNextRowIter fsState = {0};