fix(tsdb): fix some error.
This commit is contained in:
parent
8c8aa5cd57
commit
f0cec22d4f
|
@ -917,14 +917,16 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosArrayGetSize(pIndexList) == 0) {
|
// if (taosArrayGetSize(pIndexList) == 0) {
|
||||||
taosArrayPush(pIndexList, pBrinBlk);
|
taosArrayPush(pIndexList, pBrinBlk);
|
||||||
} else {
|
// } else {
|
||||||
if (newBlk) {
|
// if (newBlk) {
|
||||||
taosArrayPush(pIndexList, pBrinBlk);
|
// taosArrayPush(pIndexList, pBrinBlk);
|
||||||
}
|
// }
|
||||||
newBlk = false;
|
// newBlk = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
i += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t et2 = taosGetTimestampUs();
|
int64_t et2 = taosGetTimestampUs();
|
||||||
|
@ -942,7 +944,6 @@ _end:
|
||||||
static void doCleanupTableScanInfo(STableBlockScanInfo* pScanInfo) {
|
static void doCleanupTableScanInfo(STableBlockScanInfo* pScanInfo) {
|
||||||
// reset the index in last block when handing a new file
|
// reset the index in last block when handing a new file
|
||||||
taosArrayClear(pScanInfo->pBlockList);
|
taosArrayClear(pScanInfo->pBlockList);
|
||||||
taosArrayClear(pScanInfo->delSkyline); // built delete skyline for each fileset
|
|
||||||
taosArrayClear(pScanInfo->pfileDelData); // del data from each file set
|
taosArrayClear(pScanInfo->pfileDelData); // del data from each file set
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3254,22 +3255,25 @@ int32_t getInitialDelIndex(const SArray* pDelSkyline, int32_t order) {
|
||||||
int32_t initDelSkylineIterator(STableBlockScanInfo* pBlockScanInfo, STsdbReader* pReader) {
|
int32_t initDelSkylineIterator(STableBlockScanInfo* pBlockScanInfo, STsdbReader* pReader) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
int32_t newDelDataInFile = taosArrayGetSize(pBlockScanInfo->pfileDelData);
|
int32_t newDelDataInFile = taosArrayGetSize(pBlockScanInfo->pfileDelData);
|
||||||
if (newDelDataInFile == 0) {
|
if (newDelDataInFile == 0 &&
|
||||||
|
((pBlockScanInfo->delSkyline != NULL) || (taosArrayGetSize(pBlockScanInfo->pMemDelData) == 0))) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t delInFile = taosArrayGetSize(pBlockScanInfo->pfileDelData);
|
if (pBlockScanInfo->delSkyline != NULL) {
|
||||||
if (delInFile > 0) {
|
taosArrayClear(pBlockScanInfo->delSkyline);
|
||||||
if (pBlockScanInfo->delSkyline != NULL) {
|
} else {
|
||||||
taosArrayClear(pBlockScanInfo->delSkyline);
|
pBlockScanInfo->delSkyline = taosArrayInit(4, sizeof(TSDBKEY));
|
||||||
} else {
|
|
||||||
pBlockScanInfo->delSkyline = taosArrayInit(4, sizeof(TSDBKEY));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
taosArrayAddAll(pBlockScanInfo->pfileDelData, pBlockScanInfo->pMemDelData);
|
SArray* pSource = pBlockScanInfo->pfileDelData;
|
||||||
int32_t total = taosArrayGetSize(pBlockScanInfo->pfileDelData);
|
if (pSource == NULL) {
|
||||||
code = tsdbBuildDeleteSkyline(pBlockScanInfo->pfileDelData, 0, total - 1, pBlockScanInfo->delSkyline);
|
pSource = pBlockScanInfo->pMemDelData;
|
||||||
|
} else {
|
||||||
|
taosArrayAddAll(pSource, pBlockScanInfo->pMemDelData);
|
||||||
|
}
|
||||||
|
|
||||||
|
code = tsdbBuildDeleteSkyline(pSource, 0, taosArrayGetSize(pSource) - 1, pBlockScanInfo->delSkyline);
|
||||||
|
|
||||||
taosArrayClear(pBlockScanInfo->pfileDelData);
|
taosArrayClear(pBlockScanInfo->pfileDelData);
|
||||||
int32_t index = getInitialDelIndex(pBlockScanInfo->delSkyline, pReader->order);
|
int32_t index = getInitialDelIndex(pBlockScanInfo->delSkyline, pReader->order);
|
||||||
|
|
Loading…
Reference in New Issue