modify error code passing
This commit is contained in:
parent
41dfc643b7
commit
c8ee66eee2
|
@ -170,7 +170,7 @@ int32_t cos_cp_load(char const* filepath, SCheckpoint* checkpoint) {
|
|||
|
||||
cp_body = taosMemoryMalloc(size + 1);
|
||||
if (!cp_body) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||
}
|
||||
|
||||
int64_t n = taosReadFile(fd, cp_body, size);
|
||||
|
|
|
@ -124,7 +124,7 @@ int32_t colDataSetVal(SColumnInfoData* pColumnInfoData, uint32_t rowIndex, const
|
|||
|
||||
char* buf = taosMemoryRealloc(pColumnInfoData->pData, newSize);
|
||||
if (buf == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pColumnInfoData->pData = buf;
|
||||
|
@ -170,7 +170,7 @@ static int32_t colDataReserve(SColumnInfoData* pColumnInfoData, size_t newSize)
|
|||
if (pColumnInfoData->varmeta.allocLen < newSize) {
|
||||
char* buf = taosMemoryRealloc(pColumnInfoData->pData, newSize);
|
||||
if (buf == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pColumnInfoData->pData = buf;
|
||||
|
@ -388,7 +388,7 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int
|
|||
if (finalNumOfRows > (*capacity)) {
|
||||
char* p = taosMemoryRealloc(pColumnInfoData->varmeta.offset, sizeof(int32_t) * (numOfRow1 + numOfRow2));
|
||||
if (p == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
*capacity = finalNumOfRows;
|
||||
|
@ -409,7 +409,7 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int
|
|||
if (pColumnInfoData->varmeta.allocLen < len + oldLen) {
|
||||
char* tmp = taosMemoryRealloc(pColumnInfoData->pData, len + oldLen);
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pColumnInfoData->pData = tmp;
|
||||
|
@ -425,14 +425,14 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int
|
|||
// all data may be null, when the pColumnInfoData->info.type == 0, bytes == 0;
|
||||
char* tmp = taosMemoryRealloc(pColumnInfoData->pData, finalNumOfRows * pColumnInfoData->info.bytes);
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pColumnInfoData->pData = tmp;
|
||||
if (BitmapLen(numOfRow1) < BitmapLen(finalNumOfRows)) {
|
||||
char* btmp = taosMemoryRealloc(pColumnInfoData->nullbitmap, BitmapLen(finalNumOfRows));
|
||||
if (btmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
uint32_t extend = BitmapLen(finalNumOfRows) - BitmapLen(numOfRow1);
|
||||
memset(btmp + BitmapLen(numOfRow1), 0, extend);
|
||||
|
@ -469,7 +469,7 @@ int32_t colDataAssign(SColumnInfoData* pColumnInfoData, const SColumnInfoData* p
|
|||
if (pColumnInfoData->varmeta.allocLen < newLen) {
|
||||
char* tmp = taosMemoryRealloc(pColumnInfoData->pData, newLen);
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pColumnInfoData->pData = tmp;
|
||||
|
@ -545,7 +545,7 @@ int32_t colDataAssignNRows(SColumnInfoData* pDst, int32_t dstIdx, const SColumnI
|
|||
if (pDst->varmeta.allocLen < pDst->varmeta.length + allLen) {
|
||||
char* tmp = taosMemoryRealloc(pDst->pData, pDst->varmeta.length + allLen);
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pDst->pData = tmp;
|
||||
|
@ -995,7 +995,7 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
|
|||
size_t metaSize = pBlock->info.rows * sizeof(int32_t);
|
||||
char* tmp = taosMemoryRealloc(pCol->varmeta.offset, metaSize); // preview calloc is too small
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pCol->varmeta.offset = (int32_t*)tmp;
|
||||
|
@ -1013,7 +1013,7 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
|
|||
if (pCol->varmeta.allocLen < colLength) {
|
||||
char* tmp = taosMemoryRealloc(pCol->pData, colLength);
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pCol->pData = tmp;
|
||||
|
@ -1094,7 +1094,7 @@ int32_t blockDataFromBuf1(SSDataBlock* pBlock, const char* buf, size_t capacity)
|
|||
if (pCol->varmeta.allocLen < colLength) {
|
||||
char* tmp = taosMemoryRealloc(pCol->pData, colLength);
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pCol->pData = tmp;
|
||||
|
@ -1417,7 +1417,6 @@ int32_t blockDataSort(SSDataBlock* pDataBlock, SArray* pOrderInfo) {
|
|||
|
||||
int32_t* index = createTupleIndex(rows);
|
||||
if (index == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -1540,7 +1539,7 @@ int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* pBlockI
|
|||
if (IS_VAR_DATA_TYPE(pColumn->info.type)) {
|
||||
char* tmp = taosMemoryRealloc(pColumn->varmeta.offset, sizeof(int32_t) * numOfRows);
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pColumn->varmeta.offset = (int32_t*)tmp;
|
||||
|
@ -1549,7 +1548,7 @@ int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* pBlockI
|
|||
// prepare for the null bitmap
|
||||
char* tmp = taosMemoryRealloc(pColumn->nullbitmap, BitmapLen(numOfRows));
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
int32_t oldLen = BitmapLen(existedRows);
|
||||
|
@ -1563,7 +1562,7 @@ int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* pBlockI
|
|||
// to MALLOC_ALIGN_BYTES
|
||||
tmp = taosMemoryMallocAlign(MALLOC_ALIGN_BYTES, numOfRows * pColumn->info.bytes);
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
// memset(tmp, 0, numOfRows * pColumn->info.bytes);
|
||||
|
||||
|
|
|
@ -489,7 +489,7 @@ int32_t tRowBuildFromBind(SBindInfo *infos, int32_t numOfInfos, bool infoSorted,
|
|||
colVal = COL_VAL_VALUE(infos[iInfo].columnId, value);
|
||||
}
|
||||
if (taosArrayPush(colValArray, &colVal) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ int32_t tRowBuildFromBind(SBindInfo *infos, int32_t numOfInfos, bool infoSorted,
|
|||
}
|
||||
|
||||
if ((taosArrayPush(rowArray, &row)) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
|
@ -702,7 +702,7 @@ static int32_t tRowMergeImpl(SArray *aRowP, STSchema *pTSchema, int32_t iStart,
|
|||
|
||||
if (pColVal) {
|
||||
if (taosArrayPush(aColVal, pColVal) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
|
@ -1756,7 +1756,7 @@ int32_t tTagToValArray(const STag *pTag, SArray **ppArray) {
|
|||
}
|
||||
(void)tGetTagVal(p + offset, &tv, pTag->flags & TD_TAG_JSON);
|
||||
if (taosArrayPush(*ppArray, &tv) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _err;
|
||||
}
|
||||
}
|
||||
|
@ -3251,13 +3251,13 @@ int32_t tRowBuildFromBind2(SBindInfo2 *infos, int32_t numOfInfos, bool infoSorte
|
|||
}
|
||||
if ((bufArray = taosArrayInit(numOfInfos, sizeof(uint8_t *))) == NULL) {
|
||||
taosArrayDestroy(colValArray);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
for (int i = 0; i < numOfInfos; ++i) {
|
||||
if (!taosArrayPush(bufArray, &infos[i].bind->buffer)) {
|
||||
taosArrayDestroy(colValArray);
|
||||
taosArrayDestroy(bufArray);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3294,7 +3294,7 @@ int32_t tRowBuildFromBind2(SBindInfo2 *infos, int32_t numOfInfos, bool infoSorte
|
|||
colVal = COL_VAL_VALUE(infos[iInfo].columnId, value);
|
||||
}
|
||||
if (taosArrayPush(colValArray, &colVal) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
|
@ -3305,7 +3305,7 @@ int32_t tRowBuildFromBind2(SBindInfo2 *infos, int32_t numOfInfos, bool infoSorte
|
|||
}
|
||||
|
||||
if ((taosArrayPush(rowArray, &row)) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
|
@ -3502,7 +3502,7 @@ static int32_t tColDataMerge(SArray **colArr) {
|
|||
|
||||
dst = taosArrayInit(taosArrayGetSize(src), sizeof(SColData));
|
||||
if (dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < taosArrayGetSize(src); i++) {
|
||||
|
|
|
@ -179,7 +179,7 @@ int32_t epsetToStr(const SEpSet* pEpSet, char* pBuf, int32_t cap) {
|
|||
int32_t taosGenCrashJsonMsg(int signum, char** pMsg, int64_t clusterId, int64_t startTime) {
|
||||
int32_t code = 0;
|
||||
SJson* pJson = tjsonCreateObject();
|
||||
if (pJson == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (pJson == NULL) return terrno;
|
||||
|
||||
char tmp[4096] = {0};
|
||||
|
||||
|
@ -242,7 +242,7 @@ int32_t taosGenCrashJsonMsg(int signum, char** pMsg, int64_t clusterId, int64_t
|
|||
|
||||
char* pCont = tjsonToString(pJson);
|
||||
if (pCont == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_CHECK_GOTO(code, NULL, _exit);
|
||||
goto _exit;
|
||||
}
|
||||
|
|
|
@ -12026,19 +12026,19 @@ int32_t tCloneTbTSMAInfo(STableTSMAInfo *pInfo, STableTSMAInfo **pRes) {
|
|||
*pRet = *pInfo;
|
||||
if (pInfo->pFuncs) {
|
||||
pRet->pFuncs = taosArrayDup(pInfo->pFuncs, NULL);
|
||||
if (!pRet->pFuncs) code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (!pRet->pFuncs) code = terrno;
|
||||
}
|
||||
if (pInfo->pTags && code == TSDB_CODE_SUCCESS) {
|
||||
pRet->pTags = taosArrayDup(pInfo->pTags, NULL);
|
||||
if (!pRet->pTags) code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (!pRet->pTags) code = terrno;
|
||||
}
|
||||
if (pInfo->pUsedCols && code == TSDB_CODE_SUCCESS) {
|
||||
pRet->pUsedCols = taosArrayDup(pInfo->pUsedCols, NULL);
|
||||
if (!pRet->pUsedCols) code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (!pRet->pUsedCols) code = terrno;
|
||||
}
|
||||
if (pInfo->ast && code == TSDB_CODE_SUCCESS) {
|
||||
pRet->ast = taosStrdup(pInfo->ast);
|
||||
if (!pRet->ast) code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (!pRet->ast) code = terrno;
|
||||
}
|
||||
if (code) {
|
||||
tFreeAndClearTableTSMAInfo(pRet);
|
||||
|
|
|
@ -482,7 +482,7 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow, int8_t r
|
|||
if (isAlloc) {
|
||||
taosMemoryFreeClear(*ppRow);
|
||||
}
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1247,7 +1247,7 @@ static int32_t parseTsFormat(const char* formatStr, SArray* formats) {
|
|||
const TSFormatKeyWord* key = keywordSearch(formatStr);
|
||||
if (key) {
|
||||
TSFormatNode format = {.key = key, .type = TS_FORMAT_NODE_TYPE_KEYWORD};
|
||||
if (NULL == taosArrayPush(formats, &format)) TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
if (NULL == taosArrayPush(formats, &format)) TAOS_RETURN(terrno);
|
||||
formatStr += key->len;
|
||||
lastOtherFormat = NULL;
|
||||
} else {
|
||||
|
@ -1274,7 +1274,7 @@ static int32_t parseTsFormat(const char* formatStr, SArray* formats) {
|
|||
TSFormatNode format = {.type = TS_FORMAT_NODE_TYPE_CHAR, .key = NULL};
|
||||
format.c = formatStr;
|
||||
format.len = 1;
|
||||
if (NULL == taosArrayPush(formats, &format)) TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
if (NULL == taosArrayPush(formats, &format)) TAOS_RETURN(terrno);
|
||||
formatStr++;
|
||||
last = taosArrayGetLast(formats);
|
||||
}
|
||||
|
@ -1301,7 +1301,7 @@ static int32_t parseTsFormat(const char* formatStr, SArray* formats) {
|
|||
.key = NULL};
|
||||
format.c = formatStr;
|
||||
format.len = 1;
|
||||
if (NULL == taosArrayPush(formats, &format)) TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
if (NULL == taosArrayPush(formats, &format)) TAOS_RETURN(terrno);
|
||||
formatStr++;
|
||||
if (format.type == TS_FORMAT_NODE_TYPE_CHAR) lastOtherFormat = taosArrayGetLast(formats);
|
||||
}
|
||||
|
@ -1910,7 +1910,7 @@ int32_t taosTs2Char(const char* format, SArray** formats, int64_t ts, int32_t pr
|
|||
if (!*formats) {
|
||||
*formats = taosArrayInit(8, sizeof(TSFormatNode));
|
||||
if (!*formats) {
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
TAOS_CHECK_RETURN(parseTsFormat(format, *formats));
|
||||
}
|
||||
|
@ -1926,7 +1926,7 @@ int32_t taosChar2Ts(const char* format, SArray** formats, const char* tsStr, int
|
|||
if (!*formats) {
|
||||
*formats = taosArrayInit(4, sizeof(TSFormatNode));
|
||||
if (!*formats) {
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
TAOS_CHECK_RETURN(parseTsFormat(format, *formats));
|
||||
}
|
||||
|
@ -1951,7 +1951,7 @@ int32_t TEST_ts2char(const char* format, int64_t ts, int32_t precision, char* ou
|
|||
|
||||
SArray* formats = taosArrayInit(4, sizeof(TSFormatNode));
|
||||
if (!formats) {
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
TAOS_CHECK_RETURN(parseTsFormat(format, formats));
|
||||
struct STm tm;
|
||||
|
|
|
@ -345,7 +345,7 @@ int32_t dmProcessServerRunStatus(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
|||
|
||||
void *pRsp = rpcMallocCont(rspLen);
|
||||
if (pRsp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
// rspMsg.code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
// return rspMsg.code;
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ int32_t dmBuildVariablesBlock(SSDataBlock **ppBlock) {
|
|||
|
||||
pBlock->pDataBlock = taosArrayInit(pMeta[index].colNum, sizeof(SColumnInfoData));
|
||||
if (pBlock->pDataBlock == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
|
@ -393,7 +393,7 @@ int32_t dmBuildVariablesBlock(SSDataBlock **ppBlock) {
|
|||
colInfoData.info.type = pMeta[index].schema[i].type;
|
||||
colInfoData.info.bytes = pMeta[index].schema[i].bytes;
|
||||
if (taosArrayPush(pBlock->pDataBlock, &colInfoData) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ int32_t dmProcessRetrieve(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
|||
|
||||
SRetrieveMetaTableRsp *pRsp = rpcMallocCont(size);
|
||||
if (pRsp == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
dError("failed to retrieve data since %s", tstrerror(code));
|
||||
blockDataDestroy(pBlock);
|
||||
return code;
|
||||
|
|
|
@ -54,7 +54,7 @@ static int32_t dmOpenMgmt(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
|
|||
int32_t code = 0;
|
||||
SDnodeMgmt *pMgmt = taosMemoryCalloc(1, sizeof(SDnodeMgmt));
|
||||
if (pMgmt == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pMgmt->pData = pInput->pData;
|
||||
|
|
|
@ -91,7 +91,7 @@ int32_t mmReadFile(const char *path, SMnodeOpt *pOption) {
|
|||
|
||||
pData = taosMemoryMalloc(size + 1);
|
||||
if (pData == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -134,14 +134,14 @@ static int32_t mmEncodeOption(SJson *pJson, const SMnodeOpt *pOption) {
|
|||
|
||||
SJson *replicas = tjsonCreateArray();
|
||||
if (replicas == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
if ((code = tjsonAddItemToObject(pJson, "replicas", replicas)) < 0) return code;
|
||||
|
||||
for (int32_t i = 0; i < pOption->numOfTotalReplicas; ++i) {
|
||||
SJson *replica = tjsonCreateObject();
|
||||
if (replica == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
const SReplica *pReplica = pOption->replicas + i;
|
||||
|
@ -183,7 +183,7 @@ int32_t mmWriteFile(const char *path, const SMnodeOpt *pOption) {
|
|||
// terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
pJson = tjsonCreateObject();
|
||||
if (pJson == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,14 +71,14 @@ int32_t smStartWorker(SSnodeMgmt *pMgmt) {
|
|||
int32_t code = 0;
|
||||
pMgmt->writeWroker = taosArrayInit(0, sizeof(SMultiWorker *));
|
||||
if (pMgmt->writeWroker == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
return code;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < tsNumOfSnodeWriteThreads; i++) {
|
||||
SMultiWorker *pWriteWorker = taosMemoryMalloc(sizeof(SMultiWorker));
|
||||
if (pWriteWorker == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ int32_t smStartWorker(SSnodeMgmt *pMgmt) {
|
|||
return code;
|
||||
}
|
||||
if (taosArrayPush(pMgmt->writeWroker, &pWriteWorker) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t
|
|||
|
||||
pData = taosMemoryMalloc(size + 1);
|
||||
if (pData == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ static int32_t vmEncodeVnodeList(SJson *pJson, SVnodeObj **ppVnodes, int32_t num
|
|||
int32_t code = 0;
|
||||
SJson *vnodes = tjsonCreateArray();
|
||||
if (vnodes == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
if ((code = tjsonAddItemToObject(pJson, "vnodes", vnodes)) < 0) {
|
||||
tjsonDelete(vnodes);
|
||||
|
@ -181,7 +181,7 @@ static int32_t vmEncodeVnodeList(SJson *pJson, SVnodeObj **ppVnodes, int32_t num
|
|||
if (pVnode == NULL) continue;
|
||||
|
||||
SJson *vnode = tjsonCreateObject();
|
||||
if (vnode == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (vnode == NULL) return terrno;
|
||||
if ((code = tjsonAddDoubleToObject(vnode, "vgId", pVnode->vgId)) < 0) return code;
|
||||
if ((code = tjsonAddDoubleToObject(vnode, "dropped", pVnode->dropped)) < 0) return code;
|
||||
if ((code = tjsonAddDoubleToObject(vnode, "vgVersion", pVnode->vgVersion)) < 0) return code;
|
||||
|
@ -221,7 +221,7 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) {
|
|||
// terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
pJson = tjsonCreateObject();
|
||||
if (pJson == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
if ((code = vmEncodeVnodeList(pJson, ppVnodes, numOfVnodes)) != 0) goto _OVER;
|
||||
|
|
|
@ -921,7 +921,7 @@ int32_t vmProcessArbHeartBeatReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
|||
|
||||
void *pRsp = rpcMallocCont(rspLen);
|
||||
if (pRsp == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
terrno = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
|
|
@ -161,8 +161,7 @@ int32_t dmInitVars(SDnode *pDnode) {
|
|||
pData->dnodeHash = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK);
|
||||
if (pData->dnodeHash == NULL) {
|
||||
dError("failed to init dnode hash");
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno = code;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
if ((code = dmReadEps(pData)) != 0) {
|
||||
|
|
|
@ -217,7 +217,7 @@ int32_t dmReadEps(SDnodeData *pData) {
|
|||
|
||||
content = taosMemoryMalloc(size + 1);
|
||||
if (content == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ int32_t dmWriteEps(SDnodeData *pData) {
|
|||
TAOS_CHECK_GOTO(dmInitDndInfo(pData), NULL, _OVER);
|
||||
|
||||
pJson = tjsonCreateObject();
|
||||
if (pJson == NULL) TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _OVER);
|
||||
if (pJson == NULL) TAOS_CHECK_GOTO(terrno, NULL, _OVER);
|
||||
|
||||
pData->engineVer = tsVersion;
|
||||
|
||||
|
@ -329,7 +329,7 @@ int32_t dmWriteEps(SDnodeData *pData) {
|
|||
|
||||
buffer = tjsonToString(pJson);
|
||||
if (buffer == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _OVER);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _OVER);
|
||||
}
|
||||
|
||||
pFile = taosOpenFile(file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC | TD_FILE_WRITE_THROUGH);
|
||||
|
@ -575,7 +575,7 @@ static int32_t dmDecodeEpPairs(SJson *pJson, SDnodeData *pData) {
|
|||
tjsonGetUInt16ValueFromDouble(dnode, "new_port", pair.newPort, code);
|
||||
if (code < 0) return TSDB_CODE_INVALID_CFG_VALUE;
|
||||
|
||||
if (taosArrayPush(pData->oldDnodeEps, &pair) == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (taosArrayPush(pData->oldDnodeEps, &pair) == NULL) return terrno;
|
||||
}
|
||||
|
||||
return code;
|
||||
|
@ -621,7 +621,7 @@ static int32_t dmReadDnodePairs(SDnodeData *pData) {
|
|||
|
||||
content = taosMemoryMalloc(size + 1);
|
||||
if (content == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -641,7 +641,7 @@ static int32_t dmReadDnodePairs(SDnodeData *pData) {
|
|||
|
||||
pData->oldDnodeEps = taosArrayInit(1, sizeof(SDnodeEpPair));
|
||||
if (pData->oldDnodeEps == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
dError("failed to calloc dnodeEp array since %s", strerror(errno));
|
||||
goto _OVER;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ int32_t dmReadFile(const char *path, const char *name, bool *pDeployed) {
|
|||
|
||||
content = taosMemoryMalloc(size + 1);
|
||||
if (content == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ int32_t dmWriteFile(const char *path, const char *name, bool deployed) {
|
|||
|
||||
pJson = tjsonCreateObject();
|
||||
if (pJson == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ static int32_t dmWriteCheckCodeFile(char *file, char *realfile, char *key, bool
|
|||
int32_t len = ENCRYPTED_LEN(sizeof(DM_KEY_INDICATOR));
|
||||
result = taosMemoryMalloc(len);
|
||||
if (result == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
SCryptOpts opts;
|
||||
|
@ -338,7 +338,7 @@ static int32_t dmCompareEncryptKey(char *file, char *key, bool toLogFile) {
|
|||
|
||||
content = taosMemoryMalloc(size);
|
||||
if (content == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -479,7 +479,7 @@ static int32_t dmReadEncryptCodeFile(char *file, char **output) {
|
|||
|
||||
content = taosMemoryMalloc(size + 1);
|
||||
if (content == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue