fix: free datablocks that is skipped decided by firt row ts
This commit is contained in:
parent
3c7923a77e
commit
c859213ce5
|
@ -1125,6 +1125,9 @@ static int32_t createBlocksMergeSortInitialSources(SSortHandle* pHandle) {
|
||||||
int64_t firstRowTs = *(int64_t*)tsCol->pData;
|
int64_t firstRowTs = *(int64_t*)tsCol->pData;
|
||||||
if ((pOrder->order == TSDB_ORDER_ASC && firstRowTs > pHandle->currMergeLimitTs) ||
|
if ((pOrder->order == TSDB_ORDER_ASC && firstRowTs > pHandle->currMergeLimitTs) ||
|
||||||
(pOrder->order == TSDB_ORDER_DESC && firstRowTs < pHandle->currMergeLimitTs)) {
|
(pOrder->order == TSDB_ORDER_DESC && firstRowTs < pHandle->currMergeLimitTs)) {
|
||||||
|
if (bExtractedBlock) {
|
||||||
|
blockDataDestroy(pBlk);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1149,10 +1152,11 @@ static int32_t createBlocksMergeSortInitialSources(SSortHandle* pHandle) {
|
||||||
tSimpleHashClear(mUidBlk);
|
tSimpleHashClear(mUidBlk);
|
||||||
code = sortBlocksToExtSource(pHandle, aBlkSort, pOrder, aExtSrc);
|
code = sortBlocksToExtSource(pHandle, aBlkSort, pOrder, aExtSrc);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
tSimpleHashCleanup(mUidBlk);
|
for (int i = 0; i < taosArrayGetSize(aBlkSort); ++i) {
|
||||||
taosArrayDestroy(aBlkSort);
|
blockDataDestroy(taosArrayGetP(aBlkSort, i));
|
||||||
taosArrayDestroy(aExtSrc);
|
}
|
||||||
return code;
|
taosArrayClear(aBlkSort);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t el = taosGetTimestampUs() - p;
|
int64_t el = taosGetTimestampUs() - p;
|
||||||
|
@ -1165,6 +1169,7 @@ static int32_t createBlocksMergeSortInitialSources(SSortHandle* pHandle) {
|
||||||
szSort = 0;
|
szSort = 0;
|
||||||
qDebug("source %zu created", taosArrayGetSize(aExtSrc));
|
qDebug("source %zu created", taosArrayGetSize(aExtSrc));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pBlk == NULL) {
|
if (pBlk == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1180,6 +1185,9 @@ static int32_t createBlocksMergeSortInitialSources(SSortHandle* pHandle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tSimpleHashCleanup(mUidBlk);
|
tSimpleHashCleanup(mUidBlk);
|
||||||
|
for (int i = 0; i < taosArrayGetSize(aBlkSort); ++i) {
|
||||||
|
blockDataDestroy(taosArrayGetP(aBlkSort, i));
|
||||||
|
}
|
||||||
taosArrayDestroy(aBlkSort);
|
taosArrayDestroy(aBlkSort);
|
||||||
tsortClearOrderdSource(pHandle->pOrderedSource, NULL, NULL);
|
tsortClearOrderdSource(pHandle->pOrderedSource, NULL, NULL);
|
||||||
if (!tsortIsClosed(pHandle)) {
|
if (!tsortIsClosed(pHandle)) {
|
||||||
|
@ -1188,7 +1196,7 @@ static int32_t createBlocksMergeSortInitialSources(SSortHandle* pHandle) {
|
||||||
taosArrayDestroy(aExtSrc);
|
taosArrayDestroy(aExtSrc);
|
||||||
tSimpleHashCleanup(mTableNumRows);
|
tSimpleHashCleanup(mTableNumRows);
|
||||||
pHandle->type = SORT_SINGLESOURCE_SORT;
|
pHandle->type = SORT_SINGLESOURCE_SORT;
|
||||||
return TSDB_CODE_SUCCESS;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t createBlocksQuickSortInitialSources(SSortHandle* pHandle) {
|
static int32_t createBlocksQuickSortInitialSources(SSortHandle* pHandle) {
|
||||||
|
|
Loading…
Reference in New Issue