enh:modify error code passing
This commit is contained in:
parent
63d98e2c5c
commit
ae7dde1aa2
|
@ -36,11 +36,11 @@ int32_t tqAddBlockDataToRsp(const SSDataBlock* pBlock, void* pRsp, int32_t numOf
|
||||||
actualLen += sizeof(SRetrieveTableRspForTmq);
|
actualLen += sizeof(SRetrieveTableRspForTmq);
|
||||||
if (taosArrayPush(((SMqDataRspCommon*)pRsp)->blockDataLen, &actualLen) == NULL){
|
if (taosArrayPush(((SMqDataRspCommon*)pRsp)->blockDataLen, &actualLen) == NULL){
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
if (taosArrayPush(((SMqDataRspCommon*)pRsp)->blockData, &buf) == NULL) {
|
if (taosArrayPush(((SMqDataRspCommon*)pRsp)->blockData, &buf) == NULL) {
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -52,7 +52,7 @@ static int32_t tqAddBlockSchemaToRsp(const STqExecHandle* pExec, void* pRsp) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
if (taosArrayPush(((SMqDataRspCommon*)pRsp)->blockSchema, &pSW) == NULL) {
|
if (taosArrayPush(((SMqDataRspCommon*)pRsp)->blockSchema, &pSW) == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -327,12 +327,12 @@ static void tqProcessSubData(STQ* pTq, STqHandle* pHandle, STaosxRsp* pRsp, int3
|
||||||
if (pRsp->createTableNum == 0) {
|
if (pRsp->createTableNum == 0) {
|
||||||
pRsp->createTableLen = taosArrayInit(0, sizeof(int32_t));
|
pRsp->createTableLen = taosArrayInit(0, sizeof(int32_t));
|
||||||
if (pRsp->createTableLen == NULL) {
|
if (pRsp->createTableLen == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
pRsp->createTableReq = taosArrayInit(0, sizeof(void*));
|
pRsp->createTableReq = taosArrayInit(0, sizeof(void*));
|
||||||
if (pRsp->createTableReq == NULL) {
|
if (pRsp->createTableReq == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,7 +198,7 @@ int32_t initCreateTableMsg(SVCreateTbReq* pCreateTableReq, uint64_t suid, const
|
||||||
pCreateTableReq->ctb.stbName = taosStrdup((char*)tNameGetTableName(&name));
|
pCreateTableReq->ctb.stbName = taosStrdup((char*)tNameGetTableName(&name));
|
||||||
if (pCreateTableReq->ctb.stbName == NULL) { // ignore this error code
|
if (pCreateTableReq->ctb.stbName == NULL) { // ignore this error code
|
||||||
tqError("failed to duplicate the stb name:%s, failed to init create-table msg and create req table", stbFullName);
|
tqError("failed to duplicate the stb name:%s, failed to init create-table msg and create req table", stbFullName);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ static int32_t doBuildAndSendCreateTableMsg(SVnode* pVnode, char* stbFullName, S
|
||||||
|
|
||||||
void* p = taosArrayPush(tagArray, &tagVal);
|
void* p = taosArrayPush(tagArray, &tagVal);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = createDefaultTagColName(&pCreateTbReq->ctb.tagName);
|
code = createDefaultTagColName(&pCreateTbReq->ctb.tagName);
|
||||||
|
@ -317,7 +317,7 @@ static int32_t doBuildAndSendCreateTableMsg(SVnode* pVnode, char* stbFullName, S
|
||||||
}
|
}
|
||||||
void* p = taosArrayPush(tagArray, &tagVal);
|
void* p = taosArrayPush(tagArray, &tagVal);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -356,7 +356,7 @@ static int32_t doBuildAndSendCreateTableMsg(SVnode* pVnode, char* stbFullName, S
|
||||||
|
|
||||||
void* p = taosArrayPush(reqs.pArray, pCreateTbReq);
|
void* p = taosArrayPush(reqs.pArray, pCreateTbReq);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,13 +446,13 @@ int32_t doMergeExistedRows(SSubmitTbData* pExisted, const SSubmitTbData* pNew, c
|
||||||
if (pNewRow->ts < pOldRow->ts) {
|
if (pNewRow->ts < pOldRow->ts) {
|
||||||
void* p = taosArrayPush(pFinal, &pNewRow);
|
void* p = taosArrayPush(pFinal, &pNewRow);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
j += 1;
|
j += 1;
|
||||||
} else if (pNewRow->ts > pOldRow->ts) {
|
} else if (pNewRow->ts > pOldRow->ts) {
|
||||||
void* p = taosArrayPush(pFinal, &pOldRow);
|
void* p = taosArrayPush(pFinal, &pOldRow);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
k += 1;
|
k += 1;
|
||||||
|
@ -461,7 +461,7 @@ int32_t doMergeExistedRows(SSubmitTbData* pExisted, const SSubmitTbData* pNew, c
|
||||||
if (pNewRow->numOfPKs == 0) {
|
if (pNewRow->numOfPKs == 0) {
|
||||||
void* p = taosArrayPush(pFinal, &pNewRow);
|
void* p = taosArrayPush(pFinal, &pNewRow);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
k += 1;
|
k += 1;
|
||||||
|
@ -478,7 +478,7 @@ int32_t doMergeExistedRows(SSubmitTbData* pExisted, const SSubmitTbData* pNew, c
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
void* p = taosArrayPush(pFinal, &pNewRow);
|
void* p = taosArrayPush(pFinal, &pNewRow);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
j += 1;
|
j += 1;
|
||||||
|
@ -490,7 +490,7 @@ int32_t doMergeExistedRows(SSubmitTbData* pExisted, const SSubmitTbData* pNew, c
|
||||||
} else {
|
} else {
|
||||||
void* p = taosArrayPush(pFinal, &pOldRow);
|
void* p = taosArrayPush(pFinal, &pOldRow);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
k += 1;
|
k += 1;
|
||||||
|
@ -503,7 +503,7 @@ int32_t doMergeExistedRows(SSubmitTbData* pExisted, const SSubmitTbData* pNew, c
|
||||||
SRow* pRow = *(SRow**)TARRAY_GET_ELEM(pNew->aRowP, j++);
|
SRow* pRow = *(SRow**)TARRAY_GET_ELEM(pNew->aRowP, j++);
|
||||||
void* p = taosArrayPush(pFinal, &pRow);
|
void* p = taosArrayPush(pFinal, &pRow);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,7 +511,7 @@ int32_t doMergeExistedRows(SSubmitTbData* pExisted, const SSubmitTbData* pNew, c
|
||||||
SRow* pRow = *(SRow**)TARRAY_GET_ELEM(pExisted->aRowP, k++);
|
SRow* pRow = *(SRow**)TARRAY_GET_ELEM(pExisted->aRowP, k++);
|
||||||
void* p = taosArrayPush(pFinal, &pRow);
|
void* p = taosArrayPush(pFinal, &pRow);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -564,7 +564,7 @@ int32_t buildAutoCreateTableReq(const char* stbFullName, int64_t suid, int32_t n
|
||||||
STagVal tagVal = {.cid = numOfCols, .type = TSDB_DATA_TYPE_UBIGINT, .i64 = pDataBlock->info.id.groupId};
|
STagVal tagVal = {.cid = numOfCols, .type = TSDB_DATA_TYPE_UBIGINT, .i64 = pDataBlock->info.id.groupId};
|
||||||
void* p = taosArrayPush(pTagArray, &tagVal);
|
void* p = taosArrayPush(pTagArray, &tagVal);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = tTagNew(pTagArray, 1, false, (STag**)&pCreateTbReq->ctb.pTag);
|
code = tTagNew(pTagArray, 1, false, (STag**)&pCreateTbReq->ctb.pTag);
|
||||||
|
@ -604,7 +604,7 @@ int32_t buildSubmitMsgImpl(SSubmitReq2* pSubmitReq, int32_t vgId, void** pMsg, i
|
||||||
pBuf = rpcMallocCont(len);
|
pBuf = rpcMallocCont(len);
|
||||||
if (NULL == pBuf) {
|
if (NULL == pBuf) {
|
||||||
tDestroySubmitReq(pSubmitReq, TSDB_MSG_FLG_ENCODE);
|
tDestroySubmitReq(pSubmitReq, TSDB_MSG_FLG_ENCODE);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
((SSubmitReq2Msg*)pBuf)->header.vgId = vgId;
|
((SSubmitReq2Msg*)pBuf)->header.vgId = vgId;
|
||||||
|
@ -652,7 +652,7 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat
|
||||||
taosArrayDestroy(pTableData->aRowP);
|
taosArrayDestroy(pTableData->aRowP);
|
||||||
pTableData->aRowP = NULL;
|
pTableData->aRowP = NULL;
|
||||||
taosArrayDestroy(pVals);
|
taosArrayDestroy(pVals);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
tqError("s-task:%s failed to prepare write stream res blocks, code:%s", id, tstrerror(code));
|
tqError("s-task:%s failed to prepare write stream res blocks, code:%s", id, tstrerror(code));
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -695,7 +695,7 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat
|
||||||
SColVal cv = COL_VAL_NULL(pCol->colId, pCol->type);
|
SColVal cv = COL_VAL_NULL(pCol->colId, pCol->type);
|
||||||
void* p = taosArrayPush(pVals, &cv);
|
void* p = taosArrayPush(pVals, &cv);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SColumnInfoData* pColData = taosArrayGet(pDataBlock->pDataBlock, dataIndex);
|
SColumnInfoData* pColData = taosArrayGet(pDataBlock->pDataBlock, dataIndex);
|
||||||
|
@ -713,7 +713,7 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat
|
||||||
SColVal cv = COL_VAL_NULL(pCol->colId, pCol->type);
|
SColVal cv = COL_VAL_NULL(pCol->colId, pCol->type);
|
||||||
void* p = taosArrayPush(pVals, &cv);
|
void* p = taosArrayPush(pVals, &cv);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataIndex++;
|
dataIndex++;
|
||||||
|
@ -725,7 +725,7 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat
|
||||||
SColVal cv = COL_VAL_VALUE(pCol->colId, sv);
|
SColVal cv = COL_VAL_VALUE(pCol->colId, sv);
|
||||||
void* p = taosArrayPush(pVals, &cv);
|
void* p = taosArrayPush(pVals, &cv);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SValue sv = {.type = pCol->type};
|
SValue sv = {.type = pCol->type};
|
||||||
|
@ -733,7 +733,7 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat
|
||||||
SColVal cv = COL_VAL_VALUE(pCol->colId, sv);
|
SColVal cv = COL_VAL_VALUE(pCol->colId, sv);
|
||||||
void* p = taosArrayPush(pVals, &cv);
|
void* p = taosArrayPush(pVals, &cv);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dataIndex++;
|
dataIndex++;
|
||||||
|
@ -752,7 +752,7 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat
|
||||||
|
|
||||||
void* p = taosArrayPush(pTableData->aRowP, &pRow);
|
void* p = taosArrayPush(pTableData->aRowP, &pRow);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1026,7 +1026,7 @@ void tqSinkDataIntoDstTable(SStreamTask* pTask, void* vnode, void* data) {
|
||||||
|
|
||||||
SSubmitReq2 submitReq = {.aSubmitTbData = taosArrayInit(1, sizeof(SSubmitTbData))};
|
SSubmitReq2 submitReq = {.aSubmitTbData = taosArrayInit(1, sizeof(SSubmitTbData))};
|
||||||
if (submitReq.aSubmitTbData == NULL) {
|
if (submitReq.aSubmitTbData == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
tqError("s-task:%s vgId:%d failed to prepare submit msg in sink task, code:%s", id, vgId, tstrerror(code));
|
tqError("s-task:%s vgId:%d failed to prepare submit msg in sink task, code:%s", id, vgId, tstrerror(code));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1066,7 +1066,7 @@ void tqSinkDataIntoDstTable(SStreamTask* pTask, void* vnode, void* data) {
|
||||||
|
|
||||||
SSubmitReq2 submitReq = {.aSubmitTbData = taosArrayInit(1, sizeof(SSubmitTbData))};
|
SSubmitReq2 submitReq = {.aSubmitTbData = taosArrayInit(1, sizeof(SSubmitTbData))};
|
||||||
if (submitReq.aSubmitTbData == NULL) {
|
if (submitReq.aSubmitTbData == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
tqError("s-task:%s vgId:%d failed to prepare submit msg in sink task, code:%s", id, vgId, tstrerror(code));
|
tqError("s-task:%s vgId:%d failed to prepare submit msg in sink task, code:%s", id, vgId, tstrerror(code));
|
||||||
taosHashCleanup(pTableIndexMap);
|
taosHashCleanup(pTableIndexMap);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -33,7 +33,7 @@ int32_t tqSnapReaderOpen(STQ* pTq, int64_t sver, int64_t ever, int8_t type, STqS
|
||||||
// alloc
|
// alloc
|
||||||
pReader = (STqSnapReader*)taosMemoryCalloc(1, sizeof(STqSnapReader));
|
pReader = (STqSnapReader*)taosMemoryCalloc(1, sizeof(STqSnapReader));
|
||||||
if (pReader == NULL) {
|
if (pReader == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
pReader->pTq = pTq;
|
pReader->pTq = pTq;
|
||||||
|
|
|
@ -95,7 +95,7 @@ int32_t streamStateSnapRead(SStreamStateReader* pReader, uint8_t** ppData) {
|
||||||
}
|
}
|
||||||
*ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + len);
|
*ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + len);
|
||||||
if (*ppData == NULL) {
|
if (*ppData == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
// refactor later, avoid mem/free freq
|
// refactor later, avoid mem/free freq
|
||||||
|
|
|
@ -96,7 +96,7 @@ int32_t tqScanWalInFuture(STQ* pTq, int32_t numOfTasks, int32_t idleDuration) {
|
||||||
|
|
||||||
SBuildScanWalMsgParam* pParam = taosMemoryMalloc(sizeof(SBuildScanWalMsgParam));
|
SBuildScanWalMsgParam* pParam = taosMemoryMalloc(sizeof(SBuildScanWalMsgParam));
|
||||||
if (pParam == NULL) {
|
if (pParam == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
pParam->pTq = pTq;
|
pParam->pTq = pTq;
|
||||||
|
|
|
@ -46,7 +46,7 @@ int32_t streamTaskSnapReaderOpen(STQ* pTq, int64_t sver, int64_t ever, SStreamTa
|
||||||
pReader->ever = ever;
|
pReader->ever = ever;
|
||||||
pReader->tdbTbList = taosArrayInit(4, sizeof(STablePair));
|
pReader->tdbTbList = taosArrayInit(4, sizeof(STablePair));
|
||||||
if (pReader->tdbTbList == NULL) {
|
if (pReader->tdbTbList == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _err);
|
TAOS_CHECK_GOTO(terrno, NULL, _err);
|
||||||
}
|
}
|
||||||
|
|
||||||
STablePair pair1 = {.tbl = pTq->pStreamMeta->pTaskDb, .type = SNAP_DATA_STREAM_TASK};
|
STablePair pair1 = {.tbl = pTq->pStreamMeta->pTaskDb, .type = SNAP_DATA_STREAM_TASK};
|
||||||
|
@ -159,7 +159,7 @@ NextTbl:
|
||||||
}
|
}
|
||||||
*ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + vLen);
|
*ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + vLen);
|
||||||
if (*ppData == NULL) {
|
if (*ppData == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ int32_t tqInitDataRsp(SMqDataRspCommon* pRsp, STqOffsetVal pOffset) {
|
||||||
pRsp->blockDataLen = taosArrayInit(0, sizeof(int32_t));
|
pRsp->blockDataLen = taosArrayInit(0, sizeof(int32_t));
|
||||||
|
|
||||||
if (pRsp->blockData == NULL || pRsp->blockDataLen == NULL) {
|
if (pRsp->blockData == NULL || pRsp->blockDataLen == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
tOffsetCopy(&pRsp->reqOffset, &pOffset);
|
tOffsetCopy(&pRsp->reqOffset, &pOffset);
|
||||||
|
@ -71,7 +71,7 @@ static int32_t tqInitTaosxRsp(SMqDataRspCommon* pRsp, STqOffsetVal pOffset) {
|
||||||
taosArrayDestroy(pRsp->blockSchema);
|
taosArrayDestroy(pRsp->blockSchema);
|
||||||
pRsp->blockSchema = NULL;
|
pRsp->blockSchema = NULL;
|
||||||
}
|
}
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -540,7 +540,7 @@ int32_t tqDoSendDataRsp(const SRpcHandleInfo* pRpcHandleInfo, const void* pRsp,
|
||||||
int32_t tlen = sizeof(SMqRspHead) + len;
|
int32_t tlen = sizeof(SMqRspHead) + len;
|
||||||
void* buf = rpcMallocCont(tlen);
|
void* buf = rpcMallocCont(tlen);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
SMqRspHead* pHead = (SMqRspHead*)buf;
|
SMqRspHead* pHead = (SMqRspHead*)buf;
|
||||||
|
|
|
@ -578,7 +578,7 @@ int32_t tqStreamTaskProcessCheckpointReadyMsg(SStreamMeta* pMeta, SRpcMsg* pMsg)
|
||||||
{ // send checkpoint ready rsp
|
{ // send checkpoint ready rsp
|
||||||
SMStreamCheckpointReadyRspMsg* pReadyRsp = rpcMallocCont(sizeof(SMStreamCheckpointReadyRspMsg));
|
SMStreamCheckpointReadyRspMsg* pReadyRsp = rpcMallocCont(sizeof(SMStreamCheckpointReadyRspMsg));
|
||||||
if (pReadyRsp == NULL) {
|
if (pReadyRsp == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
pReadyRsp->upstreamTaskId = req.upstreamTaskId;
|
pReadyRsp->upstreamTaskId = req.upstreamTaskId;
|
||||||
|
|
|
@ -425,7 +425,7 @@ static int32_t tsdbCacheSerialize(SLastCol *pLastCol, char **value, size_t *size
|
||||||
|
|
||||||
*value = taosMemoryMalloc(*size);
|
*value = taosMemoryMalloc(*size);
|
||||||
if (NULL == *value) {
|
if (NULL == *value) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t offset = tsdbCacheSerializeV0(*value, pLastCol);
|
int32_t offset = tsdbCacheSerializeV0(*value, pLastCol);
|
||||||
|
@ -509,7 +509,7 @@ static int32_t reallocVarDataVal(SValue *pValue) {
|
||||||
if (nData > 0) {
|
if (nData > 0) {
|
||||||
uint8_t *p = taosMemoryMalloc(nData);
|
uint8_t *p = taosMemoryMalloc(nData);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
pValue->pData = p;
|
pValue->pData = p;
|
||||||
(void)memcpy(pValue->pData, pVal, nData);
|
(void)memcpy(pValue->pData, pVal, nData);
|
||||||
|
@ -1115,11 +1115,11 @@ static int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SArray
|
||||||
if (!remainCols) {
|
if (!remainCols) {
|
||||||
remainCols = taosArrayInit(num_keys * 2, sizeof(SIdxKey));
|
remainCols = taosArrayInit(num_keys * 2, sizeof(SIdxKey));
|
||||||
if (!remainCols) {
|
if (!remainCols) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!taosArrayPush(remainCols, &(SIdxKey){i, *key})) {
|
if (!taosArrayPush(remainCols, &(SIdxKey){i, *key})) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1273,7 +1273,7 @@ int32_t tsdbCacheRowFormatUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, int6
|
||||||
for (SColVal *pColVal = tsdbRowIterNext(&iter); pColVal && iCol < nCol; pColVal = tsdbRowIterNext(&iter), iCol++) {
|
for (SColVal *pColVal = tsdbRowIterNext(&iter); pColVal && iCol < nCol; pColVal = tsdbRowIterNext(&iter), iCol++) {
|
||||||
SLastUpdateCtx updateCtx = {.lflag = LFLAG_LAST_ROW, .tsdbRowKey = tsdbRowKey, .colVal = *pColVal};
|
SLastUpdateCtx updateCtx = {.lflag = LFLAG_LAST_ROW, .tsdbRowKey = tsdbRowKey, .colVal = *pColVal};
|
||||||
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!COL_VAL_IS_VALUE(pColVal)) {
|
if (!COL_VAL_IS_VALUE(pColVal)) {
|
||||||
|
@ -1284,7 +1284,7 @@ int32_t tsdbCacheRowFormatUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, int6
|
||||||
}
|
}
|
||||||
updateCtx.lflag = LFLAG_LAST;
|
updateCtx.lflag = LFLAG_LAST;
|
||||||
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tsdbRowClose(&iter);
|
tsdbRowClose(&iter);
|
||||||
|
@ -1310,7 +1310,7 @@ int32_t tsdbCacheRowFormatUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, int6
|
||||||
if (COL_VAL_IS_VALUE(&colVal)) {
|
if (COL_VAL_IS_VALUE(&colVal)) {
|
||||||
SLastUpdateCtx updateCtx = {.lflag = LFLAG_LAST, .tsdbRowKey = tsdbRowKey, .colVal = colVal};
|
SLastUpdateCtx updateCtx = {.lflag = LFLAG_LAST, .tsdbRowKey = tsdbRowKey, .colVal = colVal};
|
||||||
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
(void)tSimpleHashIterateRemove(iColHash, &iCol, sizeof(iCol), &pIte, &iter);
|
(void)tSimpleHashIterateRemove(iColHash, &iCol, sizeof(iCol), &pIte, &iter);
|
||||||
}
|
}
|
||||||
|
@ -1352,7 +1352,7 @@ int32_t tsdbCacheColFormatUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SBlo
|
||||||
.colVal = COL_VAL_VALUE(PRIMARYKEY_TIMESTAMP_COL_ID, ((SValue){.type = TSDB_DATA_TYPE_TIMESTAMP,
|
.colVal = COL_VAL_VALUE(PRIMARYKEY_TIMESTAMP_COL_ID, ((SValue){.type = TSDB_DATA_TYPE_TIMESTAMP,
|
||||||
.val = lRow.pBlockData->aTSKEY[lRow.iRow]}))};
|
.val = lRow.pBlockData->aTSKEY[lRow.iRow]}))};
|
||||||
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1375,7 +1375,7 @@ int32_t tsdbCacheColFormatUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SBlo
|
||||||
|
|
||||||
SLastUpdateCtx updateCtx = {.lflag = LFLAG_LAST, .tsdbRowKey = tsdbRowKey, .colVal = colVal};
|
SLastUpdateCtx updateCtx = {.lflag = LFLAG_LAST, .tsdbRowKey = tsdbRowKey, .colVal = colVal};
|
||||||
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1388,7 +1388,7 @@ int32_t tsdbCacheColFormatUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SBlo
|
||||||
for (SColVal *pColVal = tsdbRowIterNext(&iter); pColVal; pColVal = tsdbRowIterNext(&iter)) {
|
for (SColVal *pColVal = tsdbRowIterNext(&iter); pColVal; pColVal = tsdbRowIterNext(&iter)) {
|
||||||
SLastUpdateCtx updateCtx = {.lflag = LFLAG_LAST_ROW, .tsdbRowKey = tsdbRowKey, .colVal = *pColVal};
|
SLastUpdateCtx updateCtx = {.lflag = LFLAG_LAST_ROW, .tsdbRowKey = tsdbRowKey, .colVal = *pColVal};
|
||||||
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
if (!taosArrayPush(ctxArray, &updateCtx)) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tsdbRowClose(&iter);
|
tsdbRowClose(&iter);
|
||||||
|
@ -1423,7 +1423,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
|
|
||||||
SLastKey *key = &(SLastKey){.lflag = ltype, .uid = uid, .cid = PRIMARYKEY_TIMESTAMP_COL_ID};
|
SLastKey *key = &(SLastKey){.lflag = ltype, .uid = uid, .cid = PRIMARYKEY_TIMESTAMP_COL_ID};
|
||||||
if (!taosArrayInsert(remainCols, 0, &(SIdxKey){0, *key})) {
|
if (!taosArrayInsert(remainCols, 0, &(SIdxKey){0, *key})) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1447,7 +1447,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
int lastrowIndex = 0;
|
int lastrowIndex = 0;
|
||||||
|
|
||||||
if (!slotIds || !lastColIds || !lastSlotIds || !lastrowColIds || !lastrowSlotIds) {
|
if (!slotIds || !lastColIds || !lastSlotIds || !lastrowColIds || !lastrowSlotIds) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < num_keys; ++i) {
|
for (int i = 0; i < num_keys; ++i) {
|
||||||
|
@ -1457,11 +1457,11 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
if (NULL == lastTmpIndexArray) {
|
if (NULL == lastTmpIndexArray) {
|
||||||
lastTmpIndexArray = taosArrayInit(num_keys, sizeof(int32_t));
|
lastTmpIndexArray = taosArrayInit(num_keys, sizeof(int32_t));
|
||||||
if (!lastTmpIndexArray) {
|
if (!lastTmpIndexArray) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!taosArrayPush(lastTmpIndexArray, &(i))) {
|
if (!taosArrayPush(lastTmpIndexArray, &(i))) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
lastColIds[lastIndex] = idxKey->key.cid;
|
lastColIds[lastIndex] = idxKey->key.cid;
|
||||||
lastSlotIds[lastIndex] = pr->pSlotIds[idxKey->idx];
|
lastSlotIds[lastIndex] = pr->pSlotIds[idxKey->idx];
|
||||||
|
@ -1470,11 +1470,11 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
if (NULL == lastrowTmpIndexArray) {
|
if (NULL == lastrowTmpIndexArray) {
|
||||||
lastrowTmpIndexArray = taosArrayInit(num_keys, sizeof(int32_t));
|
lastrowTmpIndexArray = taosArrayInit(num_keys, sizeof(int32_t));
|
||||||
if (!lastrowTmpIndexArray) {
|
if (!lastrowTmpIndexArray) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!taosArrayPush(lastrowTmpIndexArray, &(i))) {
|
if (!taosArrayPush(lastrowTmpIndexArray, &(i))) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
lastrowColIds[lastrowIndex] = idxKey->key.cid;
|
lastrowColIds[lastrowIndex] = idxKey->key.cid;
|
||||||
lastrowSlotIds[lastrowIndex] = pr->pSlotIds[idxKey->idx];
|
lastrowSlotIds[lastrowIndex] = pr->pSlotIds[idxKey->idx];
|
||||||
|
@ -1484,7 +1484,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
|
|
||||||
pTmpColArray = taosArrayInit(lastIndex + lastrowIndex, sizeof(SLastCol));
|
pTmpColArray = taosArrayInit(lastIndex + lastrowIndex, sizeof(SLastCol));
|
||||||
if (!pTmpColArray) {
|
if (!pTmpColArray) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastTmpIndexArray != NULL) {
|
if (lastTmpIndexArray != NULL) {
|
||||||
|
@ -1492,7 +1492,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
for (int i = 0; i < taosArrayGetSize(lastTmpColArray); i++) {
|
for (int i = 0; i < taosArrayGetSize(lastTmpColArray); i++) {
|
||||||
if (!taosArrayInsert(pTmpColArray, *(int32_t *)taosArrayGet(lastTmpIndexArray, i),
|
if (!taosArrayInsert(pTmpColArray, *(int32_t *)taosArrayGet(lastTmpIndexArray, i),
|
||||||
taosArrayGet(lastTmpColArray, i))) {
|
taosArrayGet(lastTmpColArray, i))) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1502,7 +1502,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
for (int i = 0; i < taosArrayGetSize(lastrowTmpColArray); i++) {
|
for (int i = 0; i < taosArrayGetSize(lastrowTmpColArray); i++) {
|
||||||
if (!taosArrayInsert(pTmpColArray, *(int32_t *)taosArrayGet(lastrowTmpIndexArray, i),
|
if (!taosArrayInsert(pTmpColArray, *(int32_t *)taosArrayGet(lastrowTmpIndexArray, i),
|
||||||
taosArrayGet(lastrowTmpColArray, i))) {
|
taosArrayGet(lastrowTmpColArray, i))) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1594,7 +1594,7 @@ static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastA
|
||||||
if (!keys_list || !keys_list_sizes || !key_list) {
|
if (!keys_list || !keys_list_sizes || !key_list) {
|
||||||
taosMemoryFree(keys_list);
|
taosMemoryFree(keys_list);
|
||||||
taosMemoryFree(keys_list_sizes);
|
taosMemoryFree(keys_list_sizes);
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
char **values_list = NULL;
|
char **values_list = NULL;
|
||||||
size_t *values_list_sizes = NULL;
|
size_t *values_list_sizes = NULL;
|
||||||
|
@ -1631,7 +1631,7 @@ static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastA
|
||||||
SLastCol *pTmpLastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
SLastCol *pTmpLastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
||||||
if (!pTmpLastCol) {
|
if (!pTmpLastCol) {
|
||||||
taosMemoryFreeClear(pToFree);
|
taosMemoryFreeClear(pToFree);
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t charge = 0;
|
size_t charge = 0;
|
||||||
|
@ -1720,7 +1720,7 @@ int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCache
|
||||||
TAOS_CHECK_GOTO(tsdbCacheReallocSLastCol(&lastCol, NULL), NULL, _exit);
|
TAOS_CHECK_GOTO(tsdbCacheReallocSLastCol(&lastCol, NULL), NULL, _exit);
|
||||||
|
|
||||||
if (taosArrayPush(pLastArray, &lastCol) == NULL) {
|
if (taosArrayPush(pLastArray, &lastCol) == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1729,29 +1729,29 @@ int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCache
|
||||||
.colVal = COL_VAL_NONE(cid, pr->pSchema->columns[pr->pSlotIds[i]].type)};
|
.colVal = COL_VAL_NONE(cid, pr->pSchema->columns[pr->pSlotIds[i]].type)};
|
||||||
|
|
||||||
if (taosArrayPush(pLastArray, &noneCol) == NULL) {
|
if (taosArrayPush(pLastArray, &noneCol) == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!remainCols) {
|
if (!remainCols) {
|
||||||
if ((remainCols = taosArrayInit(numKeys, sizeof(SIdxKey))) == NULL) {
|
if ((remainCols = taosArrayInit(numKeys, sizeof(SIdxKey))) == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ignoreFromRocks) {
|
if (!ignoreFromRocks) {
|
||||||
if ((ignoreFromRocks = taosArrayInit(numKeys, sizeof(bool))) == NULL) {
|
if ((ignoreFromRocks = taosArrayInit(numKeys, sizeof(bool))) == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (taosArrayPush(remainCols, &(SIdxKey){i, key}) == NULL) {
|
if (taosArrayPush(remainCols, &(SIdxKey){i, key}) == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
bool ignoreRocks = pLastCol ? (pLastCol->cacheStatus == TSDB_LAST_CACHE_NO_CACHE) : false;
|
bool ignoreRocks = pLastCol ? (pLastCol->cacheStatus == TSDB_LAST_CACHE_NO_CACHE) : false;
|
||||||
if (taosArrayPush(ignoreFromRocks, &ignoreRocks) == NULL) {
|
if (taosArrayPush(ignoreFromRocks, &ignoreRocks) == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1844,7 +1844,7 @@ int32_t tsdbCacheDel(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSKEY sKey, TSKE
|
||||||
remainCols = taosArrayInit(numCols * 2, sizeof(SIdxKey));
|
remainCols = taosArrayInit(numCols * 2, sizeof(SIdxKey));
|
||||||
}
|
}
|
||||||
if (!taosArrayPush(remainCols, &(SIdxKey){i, lastKey})) {
|
if (!taosArrayPush(remainCols, &(SIdxKey){i, lastKey})) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2032,7 +2032,7 @@ static int32_t getTableDelDataFromTbData(STbData *pTbData, SArray *aDelData) {
|
||||||
|
|
||||||
for (; pDelData; pDelData = pDelData->pNext) {
|
for (; pDelData; pDelData = pDelData->pNext) {
|
||||||
if (!taosArrayPush(aDelData, pDelData)) {
|
if (!taosArrayPush(aDelData, pDelData)) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2098,7 +2098,7 @@ static int32_t loadTombFromBlk(const TTombBlkArray *pTombBlkArray, SCacheRowsRea
|
||||||
uint64_t *uidList = getUidList(pReader);
|
uint64_t *uidList = getUidList(pReader);
|
||||||
|
|
||||||
if (!uidList) {
|
if (!uidList) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0, j = 0; i < pTombBlkArray->size && j < numOfTables; ++i) {
|
for (int i = 0, j = 0; i < pTombBlkArray->size && j < numOfTables; ++i) {
|
||||||
|
@ -2176,7 +2176,7 @@ static int32_t loadTombFromBlk(const TTombBlkArray *pTombBlkArray, SCacheRowsRea
|
||||||
if (pInfo->pTombData == NULL) {
|
if (pInfo->pTombData == NULL) {
|
||||||
pInfo->pTombData = taosArrayInit(4, sizeof(SDelData));
|
pInfo->pTombData = taosArrayInit(4, sizeof(SDelData));
|
||||||
if (!pInfo->pTombData) {
|
if (!pInfo->pTombData) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
finished = true;
|
finished = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2189,7 +2189,7 @@ static int32_t loadTombFromBlk(const TTombBlkArray *pTombBlkArray, SCacheRowsRea
|
||||||
|
|
||||||
SDelData delData = {.version = record.version, .sKey = record.skey, .eKey = record.ekey};
|
SDelData delData = {.version = record.version, .sKey = record.skey, .eKey = record.ekey};
|
||||||
if (!taosArrayPush(pInfo->pTombData, &delData)) {
|
if (!taosArrayPush(pInfo->pTombData, &delData)) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2397,7 +2397,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie
|
||||||
if (!state->pIndexList) {
|
if (!state->pIndexList) {
|
||||||
state->pIndexList = taosArrayInit(1, sizeof(SBrinBlk));
|
state->pIndexList = taosArrayInit(1, sizeof(SBrinBlk));
|
||||||
if (!state->pIndexList) {
|
if (!state->pIndexList) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _err);
|
TAOS_CHECK_GOTO(terrno, &lino, _err);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
taosArrayClear(state->pIndexList);
|
taosArrayClear(state->pIndexList);
|
||||||
|
@ -2410,7 +2410,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie
|
||||||
if (state->suid >= pBrinBlk->minTbid.suid && state->suid <= pBrinBlk->maxTbid.suid) {
|
if (state->suid >= pBrinBlk->minTbid.suid && state->suid <= pBrinBlk->maxTbid.suid) {
|
||||||
if (state->uid >= pBrinBlk->minTbid.uid && state->uid <= pBrinBlk->maxTbid.uid) {
|
if (state->uid >= pBrinBlk->minTbid.uid && state->uid <= pBrinBlk->maxTbid.uid) {
|
||||||
if (!taosArrayPush(state->pIndexList, pBrinBlk)) {
|
if (!taosArrayPush(state->pIndexList, pBrinBlk)) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _err);
|
TAOS_CHECK_GOTO(terrno, &lino, _err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (state->suid > pBrinBlk->maxTbid.suid ||
|
} else if (state->suid > pBrinBlk->maxTbid.suid ||
|
||||||
|
@ -2971,7 +2971,7 @@ static int32_t nextRowIterGet(CacheNextRowIter *pIter, TSDBROW **ppRow, bool *pI
|
||||||
|
|
||||||
if (!pIter->pSkyline) {
|
if (!pIter->pSkyline) {
|
||||||
pIter->pSkyline = taosArrayInit(32, sizeof(TSDBKEY));
|
pIter->pSkyline = taosArrayInit(32, sizeof(TSDBKEY));
|
||||||
TSDB_CHECK_NULL(pIter->pSkyline, code, lino, _err, TSDB_CODE_OUT_OF_MEMORY);
|
TSDB_CHECK_NULL(pIter->pSkyline, code, lino, _err, terrno);
|
||||||
|
|
||||||
uint64_t uid = pIter->idx.uid;
|
uint64_t uid = pIter->idx.uid;
|
||||||
STableLoadInfo *pInfo = getTableLoadInfo(pIter->pr, uid);
|
STableLoadInfo *pInfo = getTableLoadInfo(pIter->pr, uid);
|
||||||
|
@ -2979,7 +2979,7 @@ static int32_t nextRowIterGet(CacheNextRowIter *pIter, TSDBROW **ppRow, bool *pI
|
||||||
|
|
||||||
if (pInfo->pTombData == NULL) {
|
if (pInfo->pTombData == NULL) {
|
||||||
pInfo->pTombData = taosArrayInit(4, sizeof(SDelData));
|
pInfo->pTombData = taosArrayInit(4, sizeof(SDelData));
|
||||||
TSDB_CHECK_NULL(pInfo->pTombData, code, lino, _err, TSDB_CODE_OUT_OF_MEMORY);
|
TSDB_CHECK_NULL(pInfo->pTombData, code, lino, _err, terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!taosArrayAddAll(pInfo->pTombData, pIter->pMemDelData)) {
|
if (!taosArrayAddAll(pInfo->pTombData, pIter->pMemDelData)) {
|
||||||
|
@ -3024,7 +3024,7 @@ _err:
|
||||||
static int32_t initLastColArrayPartial(STSchema *pTSchema, SArray **ppColArray, int16_t *slotIds, int nCols) {
|
static int32_t initLastColArrayPartial(STSchema *pTSchema, SArray **ppColArray, int16_t *slotIds, int nCols) {
|
||||||
SArray *pColArray = taosArrayInit(nCols, sizeof(SLastCol));
|
SArray *pColArray = taosArrayInit(nCols, sizeof(SLastCol));
|
||||||
if (NULL == pColArray) {
|
if (NULL == pColArray) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < nCols; ++i) {
|
for (int32_t i = 0; i < nCols; ++i) {
|
||||||
|
@ -3032,7 +3032,7 @@ static int32_t initLastColArrayPartial(STSchema *pTSchema, SArray **ppColArray,
|
||||||
SLastCol col = {.rowKey.ts = 0,
|
SLastCol col = {.rowKey.ts = 0,
|
||||||
.colVal = COL_VAL_NULL(pTSchema->columns[slotId].colId, pTSchema->columns[slotId].type)};
|
.colVal = COL_VAL_NULL(pTSchema->columns[slotId].colId, pTSchema->columns[slotId].type)};
|
||||||
if (!taosArrayPush(pColArray, &col)) {
|
if (!taosArrayPush(pColArray, &col)) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*ppColArray = pColArray;
|
*ppColArray = pColArray;
|
||||||
|
@ -3044,7 +3044,7 @@ static int32_t cloneTSchema(STSchema *pSrc, STSchema **ppDst) {
|
||||||
int32_t len = sizeof(STSchema) + sizeof(STColumn) * pSrc->numOfCols;
|
int32_t len = sizeof(STSchema) + sizeof(STColumn) * pSrc->numOfCols;
|
||||||
*ppDst = taosMemoryMalloc(len);
|
*ppDst = taosMemoryMalloc(len);
|
||||||
if (NULL == *ppDst) {
|
if (NULL == *ppDst) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
memcpy(*ppDst, pSrc, len);
|
memcpy(*ppDst, pSrc, len);
|
||||||
|
|
||||||
|
@ -3083,14 +3083,14 @@ static int32_t mergeLastCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SC
|
||||||
if (NULL == aColArray) {
|
if (NULL == aColArray) {
|
||||||
taosArrayDestroy(pColArray);
|
taosArrayDestroy(pColArray);
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < nCols; ++i) {
|
for (int i = 0; i < nCols; ++i) {
|
||||||
if (!taosArrayPush(aColArray, &aCols[i])) {
|
if (!taosArrayPush(aColArray, &aCols[i])) {
|
||||||
taosArrayDestroy(pColArray);
|
taosArrayDestroy(pColArray);
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3260,14 +3260,14 @@ static int32_t mergeLastRowCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray,
|
||||||
if (NULL == aColArray) {
|
if (NULL == aColArray) {
|
||||||
taosArrayDestroy(pColArray);
|
taosArrayDestroy(pColArray);
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < nCols; ++i) {
|
for (int i = 0; i < nCols; ++i) {
|
||||||
if (!taosArrayPush(aColArray, &aCols[i])) {
|
if (!taosArrayPush(aColArray, &aCols[i])) {
|
||||||
taosArrayDestroy(pColArray);
|
taosArrayDestroy(pColArray);
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3496,7 +3496,7 @@ int32_t tsdbCacheSetPageS3(SLRUCache *pCache, STsdbFD *pFD, int64_t pgno, uint8_
|
||||||
_taos_lru_deleter_t deleter = deleteBCache;
|
_taos_lru_deleter_t deleter = deleteBCache;
|
||||||
uint8_t *pPg = taosMemoryMalloc(charge);
|
uint8_t *pPg = taosMemoryMalloc(charge);
|
||||||
if (!pPg) {
|
if (!pPg) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
memcpy(pPg, pPage, charge);
|
memcpy(pPg, pPage, charge);
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ static int32_t saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* p
|
||||||
|
|
||||||
SArray* funcTypeBlockArray = taosArrayInit(pReader->numOfCols, sizeof(int32_t));
|
SArray* funcTypeBlockArray = taosArrayInit(pReader->numOfCols, sizeof(int32_t));
|
||||||
if (funcTypeBlockArray == NULL) {
|
if (funcTypeBlockArray == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < pReader->numOfCols; ++i) {
|
for (int32_t i = 0; i < pReader->numOfCols; ++i) {
|
||||||
|
@ -98,7 +98,7 @@ static int32_t saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* p
|
||||||
|
|
||||||
void* px = taosArrayInsert(funcTypeBlockArray, dstSlotIds[i], pVal);
|
void* px = taosArrayInsert(funcTypeBlockArray, dstSlotIds[i], pVal);
|
||||||
if (px == NULL) {
|
if (px == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ int32_t tsdbReuseCacherowsReader(void* reader, void* pTableIdList, int32_t numOf
|
||||||
destroySttBlockReader(pReader->pLDataIterArray, NULL);
|
destroySttBlockReader(pReader->pLDataIterArray, NULL);
|
||||||
pReader->pLDataIterArray = taosArrayInit(4, POINTER_BYTES);
|
pReader->pLDataIterArray = taosArrayInit(4, POINTER_BYTES);
|
||||||
|
|
||||||
return (pReader->pLDataIterArray != NULL) ? TSDB_CODE_SUCCESS : TSDB_CODE_OUT_OF_MEMORY;
|
return (pReader->pLDataIterArray != NULL) ? TSDB_CODE_SUCCESS : terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList, int32_t numOfTables, int32_t numOfCols,
|
int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList, int32_t numOfTables, int32_t numOfCols,
|
||||||
|
@ -339,7 +339,7 @@ int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList,
|
||||||
p->transferBuf[i] = taosMemoryMalloc(p->pSchema->columns[i].bytes);
|
p->transferBuf[i] = taosMemoryMalloc(p->pSchema->columns[i].bytes);
|
||||||
if (p->transferBuf[i] == NULL) {
|
if (p->transferBuf[i] == NULL) {
|
||||||
tsdbCacherowsReaderClose(p);
|
tsdbCacherowsReaderClose(p);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -448,7 +448,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
pr->pReadSnap = NULL;
|
pr->pReadSnap = NULL;
|
||||||
pRow = taosArrayInit(TARRAY_SIZE(pr->pCidList), sizeof(SLastCol));
|
pRow = taosArrayInit(TARRAY_SIZE(pr->pCidList), sizeof(SLastCol));
|
||||||
if (pRow == NULL) {
|
if (pRow == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
if (HASTYPE(pr->type, CACHESCAN_RETRIEVE_TYPE_SINGLE)) {
|
if (HASTYPE(pr->type, CACHESCAN_RETRIEVE_TYPE_SINGLE)) {
|
||||||
SArray* pLastCols = taosArrayInit(pr->numOfCols, sizeof(SLastCol));
|
SArray* pLastCols = taosArrayInit(pr->numOfCols, sizeof(SLastCol));
|
||||||
if (pLastCols == NULL) {
|
if (pLastCols == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
SLastCol p = {.rowKey.ts = INT64_MIN, .colVal.value.type = TSDB_DATA_TYPE_BOOL, .colVal.flag = CV_FLAG_NULL};
|
SLastCol p = {.rowKey.ts = INT64_MIN, .colVal.value.type = TSDB_DATA_TYPE_BOOL, .colVal.flag = CV_FLAG_NULL};
|
||||||
void* px = taosArrayPush(pLastCols, &p);
|
void* px = taosArrayPush(pLastCols, &p);
|
||||||
if (px == NULL) {
|
if (px == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -529,7 +529,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
|
|
||||||
void* px = taosArrayPush(pLastCols, &p);
|
void* px = taosArrayPush(pLastCols, &p);
|
||||||
if (px == NULL) {
|
if (px == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -592,7 +592,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
if (TARRAY_SIZE(pTableUidList) == 0) {
|
if (TARRAY_SIZE(pTableUidList) == 0) {
|
||||||
void* px = taosArrayPush(pTableUidList, &uid);
|
void* px = taosArrayPush(pTableUidList, &uid);
|
||||||
if (px == NULL) {
|
if (px == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -668,7 +668,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
|
|
||||||
void* px = taosArrayPush(pTableUidList, &uid);
|
void* px = taosArrayPush(pTableUidList, &uid);
|
||||||
if (px == NULL) {
|
if (px == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,7 @@ static int32_t tsdbCommitInfoInit(STsdb *pTsdb) {
|
||||||
|
|
||||||
pTsdb->commitInfo->arr = taosArrayInit(0, sizeof(SFileSetCommitInfo *));
|
pTsdb->commitInfo->arr = taosArrayInit(0, sizeof(SFileSetCommitInfo *));
|
||||||
if (pTsdb->commitInfo->arr == NULL) {
|
if (pTsdb->commitInfo->arr == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
|
@ -457,7 +457,7 @@ static int32_t tsdbCommitInfoAdd(STsdb *tsdb, int32_t fid) {
|
||||||
SFileSetCommitInfo *tinfo;
|
SFileSetCommitInfo *tinfo;
|
||||||
|
|
||||||
if ((tinfo = taosMemoryMalloc(sizeof(*tinfo))) == NULL) {
|
if ((tinfo = taosMemoryMalloc(sizeof(*tinfo))) == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
tinfo->fid = fid;
|
tinfo->fid = fid;
|
||||||
tinfo->fset = NULL;
|
tinfo->fset = NULL;
|
||||||
|
@ -465,7 +465,7 @@ static int32_t tsdbCommitInfoAdd(STsdb *tsdb, int32_t fid) {
|
||||||
TAOS_CHECK_GOTO(vHashPut(tsdb->commitInfo->ht, tinfo), &lino, _exit);
|
TAOS_CHECK_GOTO(vHashPut(tsdb->commitInfo->ht, tinfo), &lino, _exit);
|
||||||
|
|
||||||
if ((taosArrayPush(tsdb->commitInfo->arr, &tinfo)) == NULL) {
|
if ((taosArrayPush(tsdb->commitInfo->arr, &tinfo)) == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
taosArraySort(tsdb->commitInfo->arr, tFileSetCommitInfoPCompare);
|
taosArraySort(tsdb->commitInfo->arr, tFileSetCommitInfoPCompare);
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ int32_t tsdbDataFileReadBrinBlk(SDataFileReader *reader, const TBrinBlkArray **b
|
||||||
if (reader->headFooter->brinBlkPtr->size > 0) {
|
if (reader->headFooter->brinBlkPtr->size > 0) {
|
||||||
data = taosMemoryMalloc(reader->headFooter->brinBlkPtr->size);
|
data = taosMemoryMalloc(reader->headFooter->brinBlkPtr->size);
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t encryptAlgorithm = reader->config->tsdb->pVnode->config.tsdbCfg.encryptAlgorithm;
|
int32_t encryptAlgorithm = reader->config->tsdb->pVnode->config.tsdbCfg.encryptAlgorithm;
|
||||||
|
@ -557,7 +557,7 @@ int32_t tsdbDataFileReadTombBlk(SDataFileReader *reader, const TTombBlkArray **t
|
||||||
|
|
||||||
if (reader->tombFooter->tombBlkPtr->size > 0) {
|
if (reader->tombFooter->tombBlkPtr->size > 0) {
|
||||||
if ((data = taosMemoryMalloc(reader->tombFooter->tombBlkPtr->size)) == NULL) {
|
if ((data = taosMemoryMalloc(reader->tombFooter->tombBlkPtr->size)) == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t encryptAlgorithm = reader->config->tsdb->pVnode->config.tsdbCfg.encryptAlgorithm;
|
int32_t encryptAlgorithm = reader->config->tsdb->pVnode->config.tsdbCfg.encryptAlgorithm;
|
||||||
|
|
|
@ -72,13 +72,13 @@ static int32_t tsdbBinaryToFS(uint8_t *pData, int64_t nData, STsdbFS *pFS) {
|
||||||
|
|
||||||
int32_t nt = tGetDFileSet(pData + n, &fSet);
|
int32_t nt = tGetDFileSet(pData + n, &fSet);
|
||||||
if (nt < 0) {
|
if (nt < 0) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
n += nt;
|
n += nt;
|
||||||
if (taosArrayPush(pFS->aDFileSet, &fSet) == NULL) {
|
if (taosArrayPush(pFS->aDFileSet, &fSet) == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ static int32_t tsdbSaveFSToFile(STsdbFS *pFS, const char *fname) {
|
||||||
int32_t size = tsdbFSToBinary(NULL, pFS) + sizeof(TSCKSUM);
|
int32_t size = tsdbFSToBinary(NULL, pFS) + sizeof(TSCKSUM);
|
||||||
pData = taosMemoryMalloc(size);
|
pData = taosMemoryMalloc(size);
|
||||||
if (pData == NULL) {
|
if (pData == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
int32_t tsize = tsdbFSToBinary(pData, pFS);
|
int32_t tsize = tsdbFSToBinary(pData, pFS);
|
||||||
|
@ -140,7 +140,7 @@ int32_t tsdbFSCreate(STsdbFS *pFS) {
|
||||||
pFS->pDelFile = NULL;
|
pFS->pDelFile = NULL;
|
||||||
pFS->aDFileSet = taosArrayInit(0, sizeof(SDFileSet));
|
pFS->aDFileSet = taosArrayInit(0, sizeof(SDFileSet));
|
||||||
if (pFS->aDFileSet == NULL) {
|
if (pFS->aDFileSet == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ static int32_t load_fs(const char *fname, STsdbFS *pFS) {
|
||||||
|
|
||||||
pData = taosMemoryMalloc(size);
|
pData = taosMemoryMalloc(size);
|
||||||
if (pData == NULL) {
|
if (pData == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
(void)taosCloseFile(&pFD);
|
(void)taosCloseFile(&pFD);
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ static int32_t tsdbNewFileSet(STsdb *pTsdb, SDFileSet *pSetTo, SDFileSet *pSetFr
|
||||||
// head
|
// head
|
||||||
pSetTo->pHeadF = (SHeadFile *)taosMemoryMalloc(sizeof(SHeadFile));
|
pSetTo->pHeadF = (SHeadFile *)taosMemoryMalloc(sizeof(SHeadFile));
|
||||||
if (pSetTo->pHeadF == NULL) {
|
if (pSetTo->pHeadF == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
*pSetTo->pHeadF = *pSetFrom->pHeadF;
|
*pSetTo->pHeadF = *pSetFrom->pHeadF;
|
||||||
|
@ -395,7 +395,7 @@ static int32_t tsdbNewFileSet(STsdb *pTsdb, SDFileSet *pSetTo, SDFileSet *pSetFr
|
||||||
// data
|
// data
|
||||||
pSetTo->pDataF = (SDataFile *)taosMemoryMalloc(sizeof(SDataFile));
|
pSetTo->pDataF = (SDataFile *)taosMemoryMalloc(sizeof(SDataFile));
|
||||||
if (pSetTo->pDataF == NULL) {
|
if (pSetTo->pDataF == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
*pSetTo->pDataF = *pSetFrom->pDataF;
|
*pSetTo->pDataF = *pSetFrom->pDataF;
|
||||||
|
@ -404,7 +404,7 @@ static int32_t tsdbNewFileSet(STsdb *pTsdb, SDFileSet *pSetTo, SDFileSet *pSetFr
|
||||||
// sma
|
// sma
|
||||||
pSetTo->pSmaF = (SSmaFile *)taosMemoryMalloc(sizeof(SSmaFile));
|
pSetTo->pSmaF = (SSmaFile *)taosMemoryMalloc(sizeof(SSmaFile));
|
||||||
if (pSetTo->pSmaF == NULL) {
|
if (pSetTo->pSmaF == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
*pSetTo->pSmaF = *pSetFrom->pSmaF;
|
*pSetTo->pSmaF = *pSetFrom->pSmaF;
|
||||||
|
@ -414,7 +414,7 @@ static int32_t tsdbNewFileSet(STsdb *pTsdb, SDFileSet *pSetTo, SDFileSet *pSetFr
|
||||||
for (int32_t iStt = 0; iStt < pSetFrom->nSttF; iStt++) {
|
for (int32_t iStt = 0; iStt < pSetFrom->nSttF; iStt++) {
|
||||||
pSetTo->aSttF[iStt] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
pSetTo->aSttF[iStt] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
||||||
if (pSetTo->aSttF[iStt] == NULL) {
|
if (pSetTo->aSttF[iStt] == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
||||||
if ((!sameDisk) || (pHeadF->commitID != pSetNew->pHeadF->commitID)) {
|
if ((!sameDisk) || (pHeadF->commitID != pSetNew->pHeadF->commitID)) {
|
||||||
pSetOld->pHeadF = (SHeadFile *)taosMemoryMalloc(sizeof(SHeadFile));
|
pSetOld->pHeadF = (SHeadFile *)taosMemoryMalloc(sizeof(SHeadFile));
|
||||||
if (pSetOld->pHeadF == NULL) {
|
if (pSetOld->pHeadF == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
*pSetOld->pHeadF = *pSetNew->pHeadF;
|
*pSetOld->pHeadF = *pSetNew->pHeadF;
|
||||||
|
@ -465,7 +465,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
||||||
if ((!sameDisk) || (pDataF->commitID != pSetNew->pDataF->commitID)) {
|
if ((!sameDisk) || (pDataF->commitID != pSetNew->pDataF->commitID)) {
|
||||||
pSetOld->pDataF = (SDataFile *)taosMemoryMalloc(sizeof(SDataFile));
|
pSetOld->pDataF = (SDataFile *)taosMemoryMalloc(sizeof(SDataFile));
|
||||||
if (pSetOld->pDataF == NULL) {
|
if (pSetOld->pDataF == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
*pSetOld->pDataF = *pSetNew->pDataF;
|
*pSetOld->pDataF = *pSetNew->pDataF;
|
||||||
|
@ -486,7 +486,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
||||||
if ((!sameDisk) || (pSmaF->commitID != pSetNew->pSmaF->commitID)) {
|
if ((!sameDisk) || (pSmaF->commitID != pSetNew->pSmaF->commitID)) {
|
||||||
pSetOld->pSmaF = (SSmaFile *)taosMemoryMalloc(sizeof(SSmaFile));
|
pSetOld->pSmaF = (SSmaFile *)taosMemoryMalloc(sizeof(SSmaFile));
|
||||||
if (pSetOld->pSmaF == NULL) {
|
if (pSetOld->pSmaF == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
*pSetOld->pSmaF = *pSetNew->pSmaF;
|
*pSetOld->pSmaF = *pSetNew->pSmaF;
|
||||||
|
@ -507,7 +507,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
||||||
if (pSetNew->nSttF > pSetOld->nSttF) {
|
if (pSetNew->nSttF > pSetOld->nSttF) {
|
||||||
pSetOld->aSttF[pSetOld->nSttF] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
pSetOld->aSttF[pSetOld->nSttF] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
||||||
if (pSetOld->aSttF[pSetOld->nSttF] == NULL) {
|
if (pSetOld->aSttF[pSetOld->nSttF] == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
*pSetOld->aSttF[pSetOld->nSttF] = *pSetNew->aSttF[pSetOld->nSttF];
|
*pSetOld->aSttF[pSetOld->nSttF] = *pSetNew->aSttF[pSetOld->nSttF];
|
||||||
|
@ -528,7 +528,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
||||||
pSetOld->nSttF = 1;
|
pSetOld->nSttF = 1;
|
||||||
pSetOld->aSttF[0] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
pSetOld->aSttF[0] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
||||||
if (pSetOld->aSttF[0] == NULL) {
|
if (pSetOld->aSttF[0] == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
*pSetOld->aSttF[0] = *pSetNew->aSttF[0];
|
*pSetOld->aSttF[0] = *pSetNew->aSttF[0];
|
||||||
|
@ -546,7 +546,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
||||||
|
|
||||||
pSetOld->aSttF[iStt] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
pSetOld->aSttF[iStt] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
||||||
if (pSetOld->aSttF[iStt] == NULL) {
|
if (pSetOld->aSttF[iStt] == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
*pSetOld->aSttF[iStt] = *pSetNew->aSttF[iStt];
|
*pSetOld->aSttF[iStt] = *pSetNew->aSttF[iStt];
|
||||||
|
@ -574,7 +574,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
||||||
for (int32_t iStt = 0; iStt < pSetNew->nSttF; iStt++) {
|
for (int32_t iStt = 0; iStt < pSetNew->nSttF; iStt++) {
|
||||||
pSetOld->aSttF[iStt] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
pSetOld->aSttF[iStt] = (SSttFile *)taosMemoryMalloc(sizeof(SSttFile));
|
||||||
if (pSetOld->aSttF[iStt] == NULL) {
|
if (pSetOld->aSttF[iStt] == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ static int32_t tsdbFSApplyChange(STsdb *pTsdb, STsdbFS *pFS) {
|
||||||
if (pDelFile == NULL || (pDelFile->commitID != pFS->pDelFile->commitID)) {
|
if (pDelFile == NULL || (pDelFile->commitID != pFS->pDelFile->commitID)) {
|
||||||
pTsdb->fs.pDelFile = (SDelFile *)taosMemoryMalloc(sizeof(SDelFile));
|
pTsdb->fs.pDelFile = (SDelFile *)taosMemoryMalloc(sizeof(SDelFile));
|
||||||
if (pTsdb->fs.pDelFile == NULL) {
|
if (pTsdb->fs.pDelFile == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,7 +668,7 @@ static int32_t tsdbFSApplyChange(STsdb *pTsdb, STsdbFS *pFS) {
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
if (taosArrayInsert(pTsdb->fs.aDFileSet, iOld, &fSet) == NULL) {
|
if (taosArrayInsert(pTsdb->fs.aDFileSet, iOld, &fSet) == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ static int32_t tsdbFSApplyChange(STsdb *pTsdb, STsdbFS *pFS) {
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
if (taosArrayInsert(pTsdb->fs.aDFileSet, iOld, &fSet) == NULL) {
|
if (taosArrayInsert(pTsdb->fs.aDFileSet, iOld, &fSet) == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ static int32_t load_json(const char *fname, cJSON **json) {
|
||||||
|
|
||||||
data = taosMemoryMalloc(size + 1);
|
data = taosMemoryMalloc(size + 1);
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosReadFile(fp, data, size) < 0) {
|
if (taosReadFile(fp, data, size) < 0) {
|
||||||
|
@ -387,7 +387,7 @@ static void tsdbFSDestroyFileObjHash(STFileHash *hash);
|
||||||
|
|
||||||
static int32_t tsdbFSAddEntryToFileObjHash(STFileHash *hash, const char *fname) {
|
static int32_t tsdbFSAddEntryToFileObjHash(STFileHash *hash, const char *fname) {
|
||||||
STFileHashEntry *entry = taosMemoryMalloc(sizeof(*entry));
|
STFileHashEntry *entry = taosMemoryMalloc(sizeof(*entry));
|
||||||
if (entry == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (entry == NULL) return terrno;
|
||||||
|
|
||||||
strncpy(entry->fname, fname, TSDB_FILENAME_LEN);
|
strncpy(entry->fname, fname, TSDB_FILENAME_LEN);
|
||||||
|
|
||||||
|
@ -752,7 +752,7 @@ int32_t tsdbDisableAndCancelAllBgTask(STsdb *pTsdb) {
|
||||||
STFileSystem *fs = pTsdb->pFS;
|
STFileSystem *fs = pTsdb->pFS;
|
||||||
SArray *channelArray = taosArrayInit(0, sizeof(SVAChannelID));
|
SArray *channelArray = taosArrayInit(0, sizeof(SVAChannelID));
|
||||||
if (channelArray == NULL) {
|
if (channelArray == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)taosThreadMutexLock(&pTsdb->mutex);
|
(void)taosThreadMutexLock(&pTsdb->mutex);
|
||||||
|
@ -913,7 +913,7 @@ int32_t tsdbFSEditCommit(STFileSystem *fs) {
|
||||||
|
|
||||||
SMergeArg *arg = taosMemoryMalloc(sizeof(*arg));
|
SMergeArg *arg = taosMemoryMalloc(sizeof(*arg));
|
||||||
if (arg == NULL) {
|
if (arg == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -962,7 +962,7 @@ int32_t tsdbFSCreateCopySnapshot(STFileSystem *fs, TFileSetArray **fsetArr) {
|
||||||
STFileSet *fset1;
|
STFileSet *fset1;
|
||||||
|
|
||||||
fsetArr[0] = taosMemoryMalloc(sizeof(TFileSetArray));
|
fsetArr[0] = taosMemoryMalloc(sizeof(TFileSetArray));
|
||||||
if (fsetArr[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (fsetArr[0] == NULL) return terrno;
|
||||||
|
|
||||||
TARRAY2_INIT(fsetArr[0]);
|
TARRAY2_INIT(fsetArr[0]);
|
||||||
|
|
||||||
|
@ -1058,7 +1058,7 @@ int32_t tsdbFSCreateCopyRangedSnapshot(STFileSystem *fs, TFileSetRangeArray *pRa
|
||||||
SHashObj *pHash = NULL;
|
SHashObj *pHash = NULL;
|
||||||
|
|
||||||
fsetArr[0] = taosMemoryMalloc(sizeof(TFileSetArray));
|
fsetArr[0] = taosMemoryMalloc(sizeof(TFileSetArray));
|
||||||
if (fsetArr == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (fsetArr == NULL) return terrno;
|
||||||
TARRAY2_INIT(fsetArr[0]);
|
TARRAY2_INIT(fsetArr[0]);
|
||||||
|
|
||||||
if (pRanges) {
|
if (pRanges) {
|
||||||
|
|
|
@ -388,7 +388,7 @@ int32_t resetDataBlockIterator(SDataBlockIter* pIter, int32_t order, bool needFr
|
||||||
if (pIter->blockList == NULL) {
|
if (pIter->blockList == NULL) {
|
||||||
pIter->blockList = taosArrayInit(4, sizeof(SFileDataBlockInfo));
|
pIter->blockList = taosArrayInit(4, sizeof(SFileDataBlockInfo));
|
||||||
if (pIter->blockList == NULL) {
|
if (pIter->blockList == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
clearDataBlockIterator(pIter, needFree);
|
clearDataBlockIterator(pIter, needFree);
|
||||||
|
@ -691,7 +691,7 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
|
||||||
|
|
||||||
void* p1 = taosArrayPush(pIndexList, pBrinBlk);
|
void* p1 = taosArrayPush(pIndexList, pBrinBlk);
|
||||||
if (p1 == NULL) {
|
if (p1 == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
i += 1;
|
i += 1;
|
||||||
|
@ -815,7 +815,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
|
||||||
pScanInfo->pBlockList = taosArrayInit(4, sizeof(SFileDataBlockInfo));
|
pScanInfo->pBlockList = taosArrayInit(4, sizeof(SFileDataBlockInfo));
|
||||||
if (pScanInfo->pBlockList == NULL) {
|
if (pScanInfo->pBlockList == NULL) {
|
||||||
clearBrinBlockIter(&iter);
|
clearBrinBlockIter(&iter);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -823,7 +823,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
|
||||||
pScanInfo->pBlockIdxList = taosArrayInit(4, sizeof(STableDataBlockIdx));
|
pScanInfo->pBlockIdxList = taosArrayInit(4, sizeof(STableDataBlockIdx));
|
||||||
if (pScanInfo->pBlockIdxList == NULL) {
|
if (pScanInfo->pBlockIdxList == NULL) {
|
||||||
clearBrinBlockIter(&iter);
|
clearBrinBlockIter(&iter);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -832,7 +832,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
|
||||||
void* p1 = taosArrayPush(pScanInfo->pBlockList, &blockInfo);
|
void* p1 = taosArrayPush(pScanInfo->pBlockList, &blockInfo);
|
||||||
if (p1 == NULL) {
|
if (p1 == NULL) {
|
||||||
clearBrinBlockIter(&iter);
|
clearBrinBlockIter(&iter);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: refactor to record the fileset skey/ekey
|
// todo: refactor to record the fileset skey/ekey
|
||||||
|
@ -861,7 +861,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
|
||||||
|
|
||||||
if (p1 == NULL) {
|
if (p1 == NULL) {
|
||||||
clearBrinBlockIter(&iter);
|
clearBrinBlockIter(&iter);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2904,7 +2904,7 @@ int32_t initDelSkylineIterator(STableBlockScanInfo* pBlockScanInfo, int32_t orde
|
||||||
} else {
|
} else {
|
||||||
pBlockScanInfo->delSkyline = taosArrayInit(4, sizeof(TSDBKEY));
|
pBlockScanInfo->delSkyline = taosArrayInit(4, sizeof(TSDBKEY));
|
||||||
if (pBlockScanInfo->delSkyline == NULL) {
|
if (pBlockScanInfo->delSkyline == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3017,7 +3017,7 @@ static int32_t moveToNextFile(STsdbReader* pReader, SBlockNumber* pBlockNum, SAr
|
||||||
size_t numOfTables = tSimpleHashGetSize(pReader->status.pTableMap);
|
size_t numOfTables = tSimpleHashGetSize(pReader->status.pTableMap);
|
||||||
SArray* pIndexList = taosArrayInit(numOfTables, sizeof(SBrinBlk));
|
SArray* pIndexList = taosArrayInit(numOfTables, sizeof(SBrinBlk));
|
||||||
if (pIndexList == NULL) {
|
if (pIndexList == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -3537,7 +3537,7 @@ static int32_t initForFirstBlockInFile(STsdbReader* pReader, SDataBlockIter* pBl
|
||||||
SBlockNumber num = {0};
|
SBlockNumber num = {0};
|
||||||
SArray* pTableList = taosArrayInit(40, POINTER_BYTES);
|
SArray* pTableList = taosArrayInit(40, POINTER_BYTES);
|
||||||
if (pTableList == NULL) {
|
if (pTableList == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t code = moveToNextFile(pReader, &num, pTableList);
|
int32_t code = moveToNextFile(pReader, &num, pTableList);
|
||||||
|
@ -4931,7 +4931,7 @@ static int32_t doSuspendCurrentReader(STsdbReader* pCurrentReader) {
|
||||||
destroySttBlockReader(pStatus->pLDataIterArray, &pCost->sttCost);
|
destroySttBlockReader(pStatus->pLDataIterArray, &pCost->sttCost);
|
||||||
pStatus->pLDataIterArray = taosArrayInit(4, POINTER_BYTES);
|
pStatus->pLDataIterArray = taosArrayInit(4, POINTER_BYTES);
|
||||||
if (pStatus->pLDataIterArray == NULL) {
|
if (pStatus->pLDataIterArray == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue