feat: check temp space availability
This commit is contained in:
parent
67559afcae
commit
2fb0c1a00f
|
@ -4015,9 +4015,10 @@ int32_t startDurationForGroupTableMergeScan(SOperatorInfo* pOperator) {
|
||||||
pInfo->pSortHandle = tsortCreateSortHandle(pInfo->pSortInfo, SORT_BLOCK_TS_MERGE, pInfo->bufPageSize, numOfBufPage,
|
pInfo->pSortHandle = tsortCreateSortHandle(pInfo->pSortInfo, SORT_BLOCK_TS_MERGE, pInfo->bufPageSize, numOfBufPage,
|
||||||
pInfo->pSortInputBlock, pTaskInfo->id.str, 0, 0, 0);
|
pInfo->pSortInputBlock, pTaskInfo->id.str, 0, 0, 0);
|
||||||
int32_t memSize = 512 * 1024 * 1024;
|
int32_t memSize = 512 * 1024 * 1024;
|
||||||
// int32_t rowBytes = blockDataGetRowSize(pInfo->pResBlock) + taosArrayGetSize(pInfo->pResBlock->pDataBlock) + sizeof(int32_t);
|
code = tsortSetSortByRowId(pInfo->pSortHandle, pInfo->bufPageSize, memSize);
|
||||||
// int32_t pageSize = TMAX(memSize/numOfTable, rowBytes);
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
tsortSetSortByRowId(pInfo->pSortHandle, pInfo->bufPageSize, memSize);
|
return code;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
pInfo->pSortHandle = tsortCreateSortHandle(pInfo->pSortInfo, SORT_BLOCK_TS_MERGE, pInfo->bufPageSize, numOfBufPage,
|
pInfo->pSortHandle = tsortCreateSortHandle(pInfo->pSortInfo, SORT_BLOCK_TS_MERGE, pInfo->bufPageSize, numOfBufPage,
|
||||||
pInfo->pSortInputBlock, pTaskInfo->id.str, 0, 0, 0);
|
pInfo->pSortInputBlock, pTaskInfo->id.str, 0, 0, 0);
|
||||||
|
@ -4210,7 +4211,10 @@ SSDataBlock* doTableMergeScan(SOperatorInfo* pOperator) {
|
||||||
} else {
|
} else {
|
||||||
if (pInfo->bNewFilesetEvent) {
|
if (pInfo->bNewFilesetEvent) {
|
||||||
stopDurationForGroupTableMergeScan(pOperator);
|
stopDurationForGroupTableMergeScan(pOperator);
|
||||||
startDurationForGroupTableMergeScan(pOperator);
|
code = startDurationForGroupTableMergeScan(pOperator);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
T_LONG_JMP(pTaskInfo->env, terrno);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Data of this group are all dumped, let's try the next group
|
// Data of this group are all dumped, let's try the next group
|
||||||
stopGroupTableMergeScan(pOperator);
|
stopGroupTableMergeScan(pOperator);
|
||||||
|
|
|
@ -1266,6 +1266,11 @@ int32_t tsortSetSortByRowId(SSortHandle* pHandle, int32_t extRowsPageSize, int32
|
||||||
SBlockOrderInfo* pOrder = taosArrayGet(pHandle->pSortInfo, 0);
|
SBlockOrderInfo* pOrder = taosArrayGet(pHandle->pSortInfo, 0);
|
||||||
pHandle->extRowsOrderInfo = *pOrder;
|
pHandle->extRowsOrderInfo = *pOrder;
|
||||||
initRowIdSort(pHandle);
|
initRowIdSort(pHandle);
|
||||||
|
if (!osTempSpaceAvailable()) {
|
||||||
|
terrno = TSDB_CODE_NO_DISKSPACE;
|
||||||
|
qError("create sort mem file failed since %s, tempDir:%s", terrstr(), tsTempDir);
|
||||||
|
return terrno;
|
||||||
|
}
|
||||||
int32_t code = createSortMemFile(pHandle);
|
int32_t code = createSortMemFile(pHandle);
|
||||||
pHandle->bSortByRowId = true;
|
pHandle->bSortByRowId = true;
|
||||||
return code;
|
return code;
|
||||||
|
|
Loading…
Reference in New Issue