Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix tsort crash caused by not enough disk space #22333

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions source/libs/executor/src/tsort.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,12 @@ static int32_t createBlocksMergeSortInitialSources(SSortHandle* pHandle) {
SArray* aExtSrc = taosArrayInit(nSrc, POINTER_BYTES);

size_t maxBufSize = pHandle->numOfPages * pHandle->pageSize;
createPageBuf(pHandle);

int32_t code = createPageBuf(pHandle);
if (code != TSDB_CODE_SUCCESS) {
taosArrayDestroy(aExtSrc);
return code;
}

SSortSource* pSrc = taosArrayGetP(pHandle->pOrderedSource, 0);
int32_t szSort = 0;
Expand Down Expand Up @@ -1070,7 +1075,7 @@ static int32_t createBlocksMergeSortInitialSources(SSortHandle* pHandle) {
taosArrayDestroy(aExtSrc);

pHandle->type = SORT_SINGLESOURCE_SORT;
return 0;
return TSDB_CODE_SUCCESS;
}

static int32_t createBlocksQuickSortInitialSources(SSortHandle* pHandle) {
Expand Down