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->pSortInputBlock, pTaskInfo->id.str, 0, 0, 0);
|
||||
int32_t memSize = 512 * 1024 * 1024;
|
||||
// int32_t rowBytes = blockDataGetRowSize(pInfo->pResBlock) + taosArrayGetSize(pInfo->pResBlock->pDataBlock) + sizeof(int32_t);
|
||||
// int32_t pageSize = TMAX(memSize/numOfTable, rowBytes);
|
||||
tsortSetSortByRowId(pInfo->pSortHandle, pInfo->bufPageSize, memSize);
|
||||
code = tsortSetSortByRowId(pInfo->pSortHandle, pInfo->bufPageSize, memSize);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
} else {
|
||||
pInfo->pSortHandle = tsortCreateSortHandle(pInfo->pSortInfo, SORT_BLOCK_TS_MERGE, pInfo->bufPageSize, numOfBufPage,
|
||||
pInfo->pSortInputBlock, pTaskInfo->id.str, 0, 0, 0);
|
||||
|
@ -4210,7 +4211,10 @@ SSDataBlock* doTableMergeScan(SOperatorInfo* pOperator) {
|
|||
} else {
|
||||
if (pInfo->bNewFilesetEvent) {
|
||||
stopDurationForGroupTableMergeScan(pOperator);
|
||||
startDurationForGroupTableMergeScan(pOperator);
|
||||
code = startDurationForGroupTableMergeScan(pOperator);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
T_LONG_JMP(pTaskInfo->env, terrno);
|
||||
}
|
||||
} else {
|
||||
// Data of this group are all dumped, let's try the next group
|
||||
stopGroupTableMergeScan(pOperator);
|
||||
|
|
|
@ -1266,6 +1266,11 @@ int32_t tsortSetSortByRowId(SSortHandle* pHandle, int32_t extRowsPageSize, int32
|
|||
SBlockOrderInfo* pOrder = taosArrayGet(pHandle->pSortInfo, 0);
|
||||
pHandle->extRowsOrderInfo = *pOrder;
|
||||
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);
|
||||
pHandle->bSortByRowId = true;
|
||||
return code;
|
||||
|
|
Loading…
Reference in New Issue