Modify error code passing for taosMemoryCalloc function in vnode
This commit is contained in:
parent
f32a17c72b
commit
06daf85130
|
@ -122,7 +122,7 @@ int32_t metaCacheOpen(SMeta* pMeta) {
|
||||||
|
|
||||||
pMeta->pCache = (SMetaCache*)taosMemoryCalloc(1, sizeof(SMetaCache));
|
pMeta->pCache = (SMetaCache*)taosMemoryCalloc(1, sizeof(SMetaCache));
|
||||||
if (pMeta->pCache == NULL) {
|
if (pMeta->pCache == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// open entry cache
|
// open entry cache
|
||||||
|
@ -131,7 +131,7 @@ int32_t metaCacheOpen(SMeta* pMeta) {
|
||||||
pMeta->pCache->sEntryCache.aBucket =
|
pMeta->pCache->sEntryCache.aBucket =
|
||||||
(SMetaCacheEntry**)taosMemoryCalloc(pMeta->pCache->sEntryCache.nBucket, sizeof(SMetaCacheEntry*));
|
(SMetaCacheEntry**)taosMemoryCalloc(pMeta->pCache->sEntryCache.nBucket, sizeof(SMetaCacheEntry*));
|
||||||
if (pMeta->pCache->sEntryCache.aBucket == NULL) {
|
if (pMeta->pCache->sEntryCache.aBucket == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// open stats cache
|
// open stats cache
|
||||||
|
@ -140,7 +140,7 @@ int32_t metaCacheOpen(SMeta* pMeta) {
|
||||||
pMeta->pCache->sStbStatsCache.aBucket =
|
pMeta->pCache->sStbStatsCache.aBucket =
|
||||||
(SMetaStbStatsEntry**)taosMemoryCalloc(pMeta->pCache->sStbStatsCache.nBucket, sizeof(SMetaStbStatsEntry*));
|
(SMetaStbStatsEntry**)taosMemoryCalloc(pMeta->pCache->sStbStatsCache.nBucket, sizeof(SMetaStbStatsEntry*));
|
||||||
if (pMeta->pCache->sStbStatsCache.aBucket == NULL) {
|
if (pMeta->pCache->sStbStatsCache.aBucket == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
pMeta->pCache->sTagFilterResCache.pUidResCache = taosLRUCacheInit(5 * 1024 * 1024, -1, 0.5);
|
pMeta->pCache->sTagFilterResCache.pUidResCache = taosLRUCacheInit(5 * 1024 * 1024, -1, 0.5);
|
||||||
|
@ -228,7 +228,7 @@ static int32_t metaRehashCache(SMetaCache* pCache, int8_t expand) {
|
||||||
|
|
||||||
SMetaCacheEntry** aBucket = (SMetaCacheEntry**)taosMemoryCalloc(nBucket, sizeof(SMetaCacheEntry*));
|
SMetaCacheEntry** aBucket = (SMetaCacheEntry**)taosMemoryCalloc(nBucket, sizeof(SMetaCacheEntry*));
|
||||||
if (aBucket == NULL) {
|
if (aBucket == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ static int32_t metaRehashStatsCache(SMetaCache* pCache, int8_t expand) {
|
||||||
|
|
||||||
SMetaStbStatsEntry** aBucket = (SMetaStbStatsEntry**)taosMemoryCalloc(nBucket, sizeof(SMetaStbStatsEntry*));
|
SMetaStbStatsEntry** aBucket = (SMetaStbStatsEntry**)taosMemoryCalloc(nBucket, sizeof(SMetaStbStatsEntry*));
|
||||||
if (aBucket == NULL) {
|
if (aBucket == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ int32_t metaOpen(SVnode *pVnode, SMeta **ppMeta, int8_t rollback) {
|
||||||
snprintf(path + offset, TSDB_FILENAME_LEN - offset - 1, "%s%s", TD_DIRSEP, VNODE_META_DIR);
|
snprintf(path + offset, TSDB_FILENAME_LEN - offset - 1, "%s%s", TD_DIRSEP, VNODE_META_DIR);
|
||||||
|
|
||||||
if ((pMeta = taosMemoryCalloc(1, sizeof(*pMeta) + strlen(path) + 1)) == NULL) {
|
if ((pMeta = taosMemoryCalloc(1, sizeof(*pMeta) + strlen(path) + 1)) == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)metaInitLock(pMeta);
|
(void)metaInitLock(pMeta);
|
||||||
|
|
|
@ -1255,7 +1255,7 @@ int32_t metaFilterTableIds(void *pVnode, SMetaFltParam *arg, SArray *pUids) {
|
||||||
SIdxCursor *pCursor = NULL;
|
SIdxCursor *pCursor = NULL;
|
||||||
pCursor = (SIdxCursor *)taosMemoryCalloc(1, sizeof(SIdxCursor));
|
pCursor = (SIdxCursor *)taosMemoryCalloc(1, sizeof(SIdxCursor));
|
||||||
if (!pCursor) {
|
if (!pCursor) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
pCursor->pMeta = pMeta;
|
pCursor->pMeta = pMeta;
|
||||||
pCursor->suid = param->suid;
|
pCursor->suid = param->suid;
|
||||||
|
|
|
@ -137,7 +137,7 @@ int32_t metaSnapWriterOpen(SMeta* pMeta, int64_t sver, int64_t ever, SMetaSnapWr
|
||||||
// alloc
|
// alloc
|
||||||
pWriter = (SMetaSnapWriter*)taosMemoryCalloc(1, sizeof(*pWriter));
|
pWriter = (SMetaSnapWriter*)taosMemoryCalloc(1, sizeof(*pWriter));
|
||||||
if (pWriter == NULL) {
|
if (pWriter == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
pWriter->pMeta = pMeta;
|
pWriter->pMeta = pMeta;
|
||||||
pWriter->sver = sver;
|
pWriter->sver = sver;
|
||||||
|
@ -304,7 +304,7 @@ int32_t buildSnapContext(SVnode* pVnode, int64_t snapVersion, int64_t suid, int8
|
||||||
SSnapContext** ctxRet) {
|
SSnapContext** ctxRet) {
|
||||||
SSnapContext* ctx = taosMemoryCalloc(1, sizeof(SSnapContext));
|
SSnapContext* ctx = taosMemoryCalloc(1, sizeof(SSnapContext));
|
||||||
if (ctx == NULL) {
|
if (ctx == NULL) {
|
||||||
return TAOS_GET_TERRNO(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
*ctxRet = ctx;
|
*ctxRet = ctx;
|
||||||
ctx->pMeta = pVnode->pMeta;
|
ctx->pMeta = pVnode->pMeta;
|
||||||
|
|
|
@ -117,10 +117,10 @@ static int32_t tdNewSmaEnv(SSma *pSma, int8_t smaType, SSmaEnv **ppEnv) {
|
||||||
SSmaEnv *pEnv = NULL;
|
SSmaEnv *pEnv = NULL;
|
||||||
|
|
||||||
pEnv = (SSmaEnv *)taosMemoryCalloc(1, sizeof(SSmaEnv));
|
pEnv = (SSmaEnv *)taosMemoryCalloc(1, sizeof(SSmaEnv));
|
||||||
*ppEnv = pEnv;
|
|
||||||
if (!pEnv) {
|
if (!pEnv) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
|
*ppEnv = pEnv;
|
||||||
|
|
||||||
SMA_ENV_TYPE(pEnv) = smaType;
|
SMA_ENV_TYPE(pEnv) = smaType;
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ static int32_t tdInitSmaStat(SSmaStat **pSmaStat, int8_t smaType, const SSma *pS
|
||||||
if (!(*pSmaStat)) {
|
if (!(*pSmaStat)) {
|
||||||
*pSmaStat = (SSmaStat *)taosMemoryCalloc(1, sizeof(SSmaStat) + sizeof(TdThread) * tsNumOfVnodeRsmaThreads);
|
*pSmaStat = (SSmaStat *)taosMemoryCalloc(1, sizeof(SSmaStat) + sizeof(TdThread) * tsNumOfVnodeRsmaThreads);
|
||||||
if (!(*pSmaStat)) {
|
if (!(*pSmaStat)) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TAOS_CHECK_GOTO(code, &lino, _exit);
|
TAOS_CHECK_GOTO(code, &lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ int32_t smaOpen(SVnode *pVnode, int8_t rollback, bool force) {
|
||||||
|
|
||||||
SSma *pSma = taosMemoryCalloc(1, sizeof(SSma));
|
SSma *pSma = taosMemoryCalloc(1, sizeof(SSma));
|
||||||
if (!pSma) {
|
if (!pSma) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
pVnode->pSma = pSma;
|
pVnode->pSma = pSma;
|
||||||
|
|
|
@ -123,7 +123,7 @@ void *tdFreeRSmaInfo(SSma *pSma, SRSmaInfo *pInfo) {
|
||||||
static FORCE_INLINE int32_t tdUidStoreInit(STbUidStore **pStore) {
|
static FORCE_INLINE int32_t tdUidStoreInit(STbUidStore **pStore) {
|
||||||
*pStore = taosMemoryCalloc(1, sizeof(STbUidStore));
|
*pStore = taosMemoryCalloc(1, sizeof(STbUidStore));
|
||||||
if (*pStore == NULL) {
|
if (*pStore == NULL) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -285,7 +285,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaStat
|
||||||
|
|
||||||
SStreamTask *pStreamTask = taosMemoryCalloc(1, sizeof(*pStreamTask));
|
SStreamTask *pStreamTask = taosMemoryCalloc(1, sizeof(*pStreamTask));
|
||||||
if (!pStreamTask) {
|
if (!pStreamTask) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
pItem->pStreamTask = pStreamTask;
|
pItem->pStreamTask = pStreamTask;
|
||||||
pStreamTask->id.taskId = 0;
|
pStreamTask->id.taskId = 0;
|
||||||
|
@ -389,7 +389,7 @@ int32_t tdRSmaProcessCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, con
|
||||||
// from write queue: single thead
|
// from write queue: single thead
|
||||||
pRSmaInfo = (SRSmaInfo *)taosMemoryCalloc(1, sizeof(SRSmaInfo));
|
pRSmaInfo = (SRSmaInfo *)taosMemoryCalloc(1, sizeof(SRSmaInfo));
|
||||||
if (!pRSmaInfo) {
|
if (!pRSmaInfo) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
STSchema *pTSchema = metaGetTbTSchema(SMA_META(pSma), suid, -1, 1);
|
STSchema *pTSchema = metaGetTbTSchema(SMA_META(pSma), suid, -1, 1);
|
||||||
|
|
|
@ -38,7 +38,7 @@ int32_t rsmaSnapReaderOpen(SSma* pSma, int64_t sver, int64_t ever, SRSmaSnapRead
|
||||||
// alloc
|
// alloc
|
||||||
pReader = (SRSmaSnapReader*)taosMemoryCalloc(1, sizeof(*pReader));
|
pReader = (SRSmaSnapReader*)taosMemoryCalloc(1, sizeof(*pReader));
|
||||||
if (pReader == NULL) {
|
if (pReader == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
pReader->pSma = pSma;
|
pReader->pSma = pSma;
|
||||||
pReader->sver = sver;
|
pReader->sver = sver;
|
||||||
|
@ -136,7 +136,7 @@ int32_t rsmaSnapWriterOpen(SSma* pSma, int64_t sver, int64_t ever, void** ppRang
|
||||||
// alloc
|
// alloc
|
||||||
pWriter = (SRSmaSnapWriter*)taosMemoryCalloc(1, sizeof(*pWriter));
|
pWriter = (SRSmaSnapWriter*)taosMemoryCalloc(1, sizeof(*pWriter));
|
||||||
if (!pWriter) {
|
if (!pWriter) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
pWriter->pSma = pSma;
|
pWriter->pSma = pSma;
|
||||||
pWriter->sver = sver;
|
pWriter->sver = sver;
|
||||||
|
|
|
@ -165,7 +165,7 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema *
|
||||||
pReq = taosMemoryCalloc(1, sizeof(SSubmitReq2));
|
pReq = taosMemoryCalloc(1, sizeof(SSubmitReq2));
|
||||||
|
|
||||||
if (!tagArray || !pReq) {
|
if (!tagArray || !pReq) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
pReq->aSubmitTbData = taosArrayInit(1, sizeof(SSubmitTbData));
|
pReq->aSubmitTbData = taosArrayInit(1, sizeof(SSubmitTbData));
|
||||||
|
|
|
@ -66,7 +66,7 @@ static bool tqOffsetEqual(const STqOffset* pLeft, const STqOffset* pRight) {
|
||||||
int32_t tqOpen(const char* path, SVnode* pVnode) {
|
int32_t tqOpen(const char* path, SVnode* pVnode) {
|
||||||
STQ* pTq = taosMemoryCalloc(1, sizeof(STQ));
|
STQ* pTq = taosMemoryCalloc(1, sizeof(STQ));
|
||||||
if (pTq == NULL) {
|
if (pTq == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
pVnode->pTq = pTq;
|
pVnode->pTq = pTq;
|
||||||
pTq->path = taosStrdup(path);
|
pTq->path = taosStrdup(path);
|
||||||
|
|
|
@ -115,7 +115,7 @@ int32_t tqMetaSaveOffset(STQ* pTq, STqOffset* pOffset) {
|
||||||
|
|
||||||
buf = taosMemoryCalloc(1, vlen);
|
buf = taosMemoryCalloc(1, vlen);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ int32_t tqMetaSaveHandle(STQ* pTq, const char* key, const STqHandle* pHandle) {
|
||||||
|
|
||||||
buf = taosMemoryCalloc(1, vlen);
|
buf = taosMemoryCalloc(1, vlen);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ int32_t tqBuildFName(char** data, const char* path, char* name) {
|
||||||
int32_t len = strlen(path) + strlen(name) + 2;
|
int32_t len = strlen(path) + strlen(name) + 2;
|
||||||
char* fname = taosMemoryCalloc(1, len);
|
char* fname = taosMemoryCalloc(1, len);
|
||||||
if(fname == NULL) {
|
if(fname == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
int32_t code = snprintf(fname, len, "%s%s%s", path, TD_DIRSEP, name);
|
int32_t code = snprintf(fname, len, "%s%s%s", path, TD_DIRSEP, name);
|
||||||
if (code < 0){
|
if (code < 0){
|
||||||
|
@ -56,7 +56,7 @@ int32_t tqOffsetRestoreFromFile(STQ* pTq, char* name) {
|
||||||
size = htonl(size);
|
size = htonl(size);
|
||||||
pMemBuf = taosMemoryCalloc(1, size);
|
pMemBuf = taosMemoryCalloc(1, size);
|
||||||
if (pMemBuf == NULL) {
|
if (pMemBuf == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -547,7 +547,7 @@ int32_t tqMaskBlock(SSchemaWrapper* pDst, SSDataBlock* pBlock, const SSchemaWrap
|
||||||
pDst->nCols = cnt;
|
pDst->nCols = cnt;
|
||||||
pDst->pSchema = taosMemoryCalloc(cnt, sizeof(SSchema));
|
pDst->pSchema = taosMemoryCalloc(cnt, sizeof(SSchema));
|
||||||
if (pDst->pSchema == NULL) {
|
if (pDst->pSchema == NULL) {
|
||||||
return TAOS_GET_TERRNO(TSDB_CODE_OUT_OF_MEMORY);
|
return TAOS_GET_TERRNO(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t j = 0;
|
int32_t j = 0;
|
||||||
|
|
|
@ -19,7 +19,7 @@ int32_t tqAddBlockDataToRsp(const SSDataBlock* pBlock, void* pRsp, int32_t numOf
|
||||||
int32_t dataStrLen = sizeof(SRetrieveTableRspForTmq) + blockGetEncodeSize(pBlock);
|
int32_t dataStrLen = sizeof(SRetrieveTableRspForTmq) + blockGetEncodeSize(pBlock);
|
||||||
void* buf = taosMemoryCalloc(1, dataStrLen);
|
void* buf = taosMemoryCalloc(1, dataStrLen);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
SRetrieveTableRspForTmq* pRetrieve = (SRetrieveTableRspForTmq*)buf;
|
SRetrieveTableRspForTmq* pRetrieve = (SRetrieveTableRspForTmq*)buf;
|
||||||
|
@ -344,7 +344,7 @@ static void tqProcessSubData(STQ* pTq, STqHandle* pHandle, STaosxRsp* pRsp, int3
|
||||||
}
|
}
|
||||||
void* createReq = taosMemoryCalloc(1, len);
|
void* createReq = taosMemoryCalloc(1, len);
|
||||||
if (createReq == NULL){
|
if (createReq == NULL){
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
SEncoder encoder = {0};
|
SEncoder encoder = {0};
|
||||||
|
|
|
@ -549,7 +549,7 @@ int32_t buildAutoCreateTableReq(const char* stbFullName, int64_t suid, int32_t n
|
||||||
|
|
||||||
SVCreateTbReq* pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
SVCreateTbReq* pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
||||||
if (pCreateTbReq == NULL) {
|
if (pCreateTbReq == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosArrayClear(pTagArray);
|
taosArrayClear(pTagArray);
|
||||||
|
@ -802,7 +802,7 @@ int32_t doCreateSinkInfo(const char* pDstTableName, STableSinkInfo** pInfo) {
|
||||||
int32_t nameLen = strlen(pDstTableName);
|
int32_t nameLen = strlen(pDstTableName);
|
||||||
(*pInfo) = taosMemoryCalloc(1, sizeof(STableSinkInfo) + nameLen + 1);
|
(*pInfo) = taosMemoryCalloc(1, sizeof(STableSinkInfo) + nameLen + 1);
|
||||||
if (*pInfo == NULL) {
|
if (*pInfo == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*pInfo)->name.len = nameLen;
|
(*pInfo)->name.len = nameLen;
|
||||||
|
|
|
@ -38,7 +38,7 @@ int32_t streamStateSnapReaderOpen(STQ* pTq, int64_t sver, int64_t ever, SStreamS
|
||||||
// alloc
|
// alloc
|
||||||
pReader = (SStreamStateReader*)taosMemoryCalloc(1, sizeof(SStreamStateReader));
|
pReader = (SStreamStateReader*)taosMemoryCalloc(1, sizeof(SStreamStateReader));
|
||||||
if (pReader == NULL) {
|
if (pReader == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ int32_t streamStateSnapWriterOpen(STQ* pTq, int64_t sver, int64_t ever, SStreamS
|
||||||
// alloc
|
// alloc
|
||||||
pWriter = (SStreamStateWriter*)taosMemoryCalloc(1, sizeof(*pWriter));
|
pWriter = (SStreamStateWriter*)taosMemoryCalloc(1, sizeof(*pWriter));
|
||||||
if (pWriter == NULL) {
|
if (pWriter == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
pWriter->pTq = pTq;
|
pWriter->pTq = pTq;
|
||||||
|
|
|
@ -39,7 +39,7 @@ int32_t streamTaskSnapReaderOpen(STQ* pTq, int64_t sver, int64_t ever, SStreamTa
|
||||||
// alloc
|
// alloc
|
||||||
pReader = (SStreamTaskReader*)taosMemoryCalloc(1, sizeof(SStreamTaskReader));
|
pReader = (SStreamTaskReader*)taosMemoryCalloc(1, sizeof(SStreamTaskReader));
|
||||||
if (pReader == NULL) {
|
if (pReader == NULL) {
|
||||||
TAOS_CHECK_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_RETURN(terrno);
|
||||||
}
|
}
|
||||||
pReader->pTq = pTq;
|
pReader->pTq = pTq;
|
||||||
pReader->sver = sver;
|
pReader->sver = sver;
|
||||||
|
@ -120,7 +120,7 @@ NextTbl:
|
||||||
} else {
|
} else {
|
||||||
pVal = taosMemoryCalloc(1, tLen);
|
pVal = taosMemoryCalloc(1, tLen);
|
||||||
if (pVal == NULL) {
|
if (pVal == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
memcpy(pVal, tVal, tLen);
|
memcpy(pVal, tVal, tLen);
|
||||||
|
@ -181,7 +181,7 @@ int32_t streamTaskSnapWriterOpen(STQ* pTq, int64_t sver, int64_t ever, SStreamTa
|
||||||
// alloc
|
// alloc
|
||||||
pWriter = (SStreamTaskWriter*)taosMemoryCalloc(1, sizeof(*pWriter));
|
pWriter = (SStreamTaskWriter*)taosMemoryCalloc(1, sizeof(*pWriter));
|
||||||
if (pWriter == NULL) {
|
if (pWriter == NULL) {
|
||||||
TAOS_CHECK_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_RETURN(terrno);
|
||||||
}
|
}
|
||||||
pWriter->pTq = pTq;
|
pWriter->pTq = pTq;
|
||||||
pWriter->sver = sver;
|
pWriter->sver = sver;
|
||||||
|
|
|
@ -582,7 +582,7 @@ int32_t tqStreamTaskProcessDeployReq(SStreamMeta* pMeta, SMsgCb* cb, int64_t sve
|
||||||
SStreamTask* pTask = taosMemoryCalloc(1, size);
|
SStreamTask* pTask = taosMemoryCalloc(1, size);
|
||||||
if (pTask == NULL) {
|
if (pTask == NULL) {
|
||||||
tqError("vgId:%d failed to create stream task due to out of memory, alloc size:%d", vgId, size);
|
tqError("vgId:%d failed to create stream task due to out of memory, alloc size:%d", vgId, size);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDecoder decoder;
|
SDecoder decoder;
|
||||||
|
|
|
@ -326,7 +326,7 @@ static int32_t tsdbCacheDeserialize(char const *value, size_t size, SLastCol **p
|
||||||
|
|
||||||
SLastCol *pLastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
SLastCol *pLastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
||||||
if (NULL == pLastCol) {
|
if (NULL == pLastCol) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t offset = tsdbCacheDeserializeV0(value, pLastCol);
|
int32_t offset = tsdbCacheDeserializeV0(value, pLastCol);
|
||||||
|
@ -632,7 +632,7 @@ static int32_t tsdbCacheNewTableColumn(STsdb *pTsdb, int64_t uid, int16_t cid, i
|
||||||
|
|
||||||
SLastCol *pLastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
SLastCol *pLastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
||||||
if (!pLastCol) {
|
if (!pLastCol) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t charge = 0;
|
size_t charge = 0;
|
||||||
|
@ -679,13 +679,17 @@ int32_t tsdbCacheCommitNoLock(STsdb *pTsdb) {
|
||||||
static int32_t tsdbCacheGetValuesFromRocks(STsdb *pTsdb, size_t numKeys, const char *const *ppKeysList,
|
static int32_t tsdbCacheGetValuesFromRocks(STsdb *pTsdb, size_t numKeys, const char *const *ppKeysList,
|
||||||
size_t *pKeysListSizes, char ***pppValuesList, size_t **ppValuesListSizes) {
|
size_t *pKeysListSizes, char ***pppValuesList, size_t **ppValuesListSizes) {
|
||||||
char **valuesList = taosMemoryCalloc(numKeys, sizeof(char *));
|
char **valuesList = taosMemoryCalloc(numKeys, sizeof(char *));
|
||||||
|
if(!valuesList) return terrno;
|
||||||
size_t *valuesListSizes = taosMemoryCalloc(numKeys, sizeof(size_t));
|
size_t *valuesListSizes = taosMemoryCalloc(numKeys, sizeof(size_t));
|
||||||
|
if(!valuesListSizes) {
|
||||||
|
taosMemoryFreeClear(valuesList);
|
||||||
|
return terrno;
|
||||||
|
}
|
||||||
char **errs = taosMemoryCalloc(numKeys, sizeof(char *));
|
char **errs = taosMemoryCalloc(numKeys, sizeof(char *));
|
||||||
if (!valuesList || !valuesListSizes || !errs) {
|
if (!errs) {
|
||||||
taosMemoryFreeClear(valuesList);
|
taosMemoryFreeClear(valuesList);
|
||||||
taosMemoryFreeClear(valuesListSizes);
|
taosMemoryFreeClear(valuesListSizes);
|
||||||
taosMemoryFreeClear(errs);
|
return terrno;
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
|
||||||
}
|
}
|
||||||
rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, numKeys, ppKeysList, pKeysListSizes, valuesList,
|
rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, numKeys, ppKeysList, pKeysListSizes, valuesList,
|
||||||
valuesListSizes, errs);
|
valuesListSizes, errs);
|
||||||
|
@ -705,12 +709,12 @@ static int32_t tsdbCacheDropTableColumn(STsdb *pTsdb, int64_t uid, int16_t cid,
|
||||||
// build keys & multi get from rocks
|
// build keys & multi get from rocks
|
||||||
char **keys_list = taosMemoryCalloc(2, sizeof(char *));
|
char **keys_list = taosMemoryCalloc(2, sizeof(char *));
|
||||||
if (!keys_list) {
|
if (!keys_list) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
size_t *keys_list_sizes = taosMemoryCalloc(2, sizeof(size_t));
|
size_t *keys_list_sizes = taosMemoryCalloc(2, sizeof(size_t));
|
||||||
if (!keys_list_sizes) {
|
if (!keys_list_sizes) {
|
||||||
taosMemoryFree(keys_list);
|
taosMemoryFree(keys_list);
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
const size_t klen = ROCKS_KEY_LEN;
|
const size_t klen = ROCKS_KEY_LEN;
|
||||||
|
|
||||||
|
@ -718,7 +722,7 @@ static int32_t tsdbCacheDropTableColumn(STsdb *pTsdb, int64_t uid, int16_t cid,
|
||||||
if (!keys) {
|
if (!keys) {
|
||||||
taosMemoryFree(keys_list);
|
taosMemoryFree(keys_list);
|
||||||
taosMemoryFree(keys_list_sizes);
|
taosMemoryFree(keys_list_sizes);
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
((SLastKey *)keys)[0] = (SLastKey){.lflag = LFLAG_LAST, .uid = uid, .cid = cid};
|
((SLastKey *)keys)[0] = (SLastKey){.lflag = LFLAG_LAST, .uid = uid, .cid = cid};
|
||||||
((SLastKey *)keys)[1] = (SLastKey){.lflag = LFLAG_LAST_ROW, .uid = uid, .cid = cid};
|
((SLastKey *)keys)[1] = (SLastKey){.lflag = LFLAG_LAST_ROW, .uid = uid, .cid = cid};
|
||||||
|
@ -1003,7 +1007,7 @@ static int32_t tsdbCacheUpdateValue(SValue *pOld, SValue *pNew) {
|
||||||
if (nData < pNew->nData) {
|
if (nData < pNew->nData) {
|
||||||
pOld->pData = taosMemoryCalloc(1, pNew->nData);
|
pOld->pData = taosMemoryCalloc(1, pNew->nData);
|
||||||
if (!pOld->pData) {
|
if (!pOld->pData) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pOld->pData = pFree;
|
pOld->pData = pFree;
|
||||||
|
@ -1099,7 +1103,7 @@ static int32_t tsdbCachePutToLRU(STsdb *pTsdb, SLastKey *pLastKey, SLastCol *pLa
|
||||||
|
|
||||||
SLastCol *pLRULastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
SLastCol *pLRULastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
||||||
if (!pLRULastCol) {
|
if (!pLRULastCol) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t charge = 0;
|
size_t charge = 0;
|
||||||
|
@ -1177,11 +1181,15 @@ static int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SArray
|
||||||
size_t *values_list_sizes = NULL;
|
size_t *values_list_sizes = NULL;
|
||||||
char **errs = NULL;
|
char **errs = NULL;
|
||||||
keys_list = taosMemoryCalloc(num_keys, sizeof(char *));
|
keys_list = taosMemoryCalloc(num_keys, sizeof(char *));
|
||||||
|
if(!keys_list) {
|
||||||
|
(void)taosThreadMutexUnlock(&pTsdb->lruMutex);
|
||||||
|
return terrno;
|
||||||
|
}
|
||||||
keys_list_sizes = taosMemoryCalloc(num_keys, sizeof(size_t));
|
keys_list_sizes = taosMemoryCalloc(num_keys, sizeof(size_t));
|
||||||
if (!keys_list || !keys_list_sizes) {
|
if (!keys_list_sizes) {
|
||||||
taosMemoryFree(keys_list);
|
taosMemoryFree(keys_list);
|
||||||
(void)taosThreadMutexUnlock(&pTsdb->lruMutex);
|
(void)taosThreadMutexUnlock(&pTsdb->lruMutex);
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
return terrno;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < num_keys; ++i) {
|
for (int i = 0; i < num_keys; ++i) {
|
||||||
SIdxKey *idxKey = &((SIdxKey *)TARRAY_DATA(remainCols))[i];
|
SIdxKey *idxKey = &((SIdxKey *)TARRAY_DATA(remainCols))[i];
|
||||||
|
@ -1549,7 +1557,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
|
|
||||||
SLastCol *pTmpLastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
SLastCol *pTmpLastCol = taosMemoryCalloc(1, sizeof(SLastCol));
|
||||||
if (!pTmpLastCol) {
|
if (!pTmpLastCol) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t charge = 0;
|
size_t charge = 0;
|
||||||
|
@ -1649,7 +1657,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);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1865,7 +1873,7 @@ int32_t tsdbCacheDel(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSKEY sKey, TSKE
|
||||||
size_t *values_list_sizes = NULL;
|
size_t *values_list_sizes = NULL;
|
||||||
|
|
||||||
if (!keys_list || !keys_list_sizes) {
|
if (!keys_list || !keys_list_sizes) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
const size_t klen = ROCKS_KEY_LEN;
|
const size_t klen = ROCKS_KEY_LEN;
|
||||||
|
@ -1873,7 +1881,7 @@ int32_t tsdbCacheDel(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSKEY sKey, TSKE
|
||||||
for (int i = 0; i < numKeys; ++i) {
|
for (int i = 0; i < numKeys; ++i) {
|
||||||
char *key = taosMemoryCalloc(1, sizeof(SLastKey));
|
char *key = taosMemoryCalloc(1, sizeof(SLastKey));
|
||||||
if (!key) {
|
if (!key) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
((SLastKey *)key)[0] = *(SLastKey *)taosArrayGet(remainCols, i);
|
((SLastKey *)key)[0] = *(SLastKey *)taosArrayGet(remainCols, i);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
static int32_t setFirstLastResColToNull(SColumnInfoData* pCol, int32_t row) {
|
static int32_t setFirstLastResColToNull(SColumnInfoData* pCol, int32_t row) {
|
||||||
char* buf = taosMemoryCalloc(1, pCol->info.bytes);
|
char* buf = taosMemoryCalloc(1, pCol->info.bytes);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
SFirstLastRes* pRes = (SFirstLastRes*)((char*)buf + VARSTR_HEADER_SIZE);
|
SFirstLastRes* pRes = (SFirstLastRes*)((char*)buf + VARSTR_HEADER_SIZE);
|
||||||
|
@ -283,7 +283,7 @@ int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList,
|
||||||
*pReader = NULL;
|
*pReader = NULL;
|
||||||
SCacheRowsReader* p = taosMemoryCalloc(1, sizeof(SCacheRowsReader));
|
SCacheRowsReader* p = taosMemoryCalloc(1, sizeof(SCacheRowsReader));
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->type = type;
|
p->type = type;
|
||||||
|
@ -323,7 +323,7 @@ int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList,
|
||||||
p->transferBuf = taosMemoryCalloc(p->pSchema->numOfCols, POINTER_BYTES);
|
p->transferBuf = taosMemoryCalloc(p->pSchema->numOfCols, POINTER_BYTES);
|
||||||
if (p->transferBuf == NULL) {
|
if (p->transferBuf == NULL) {
|
||||||
tsdbCacherowsReaderClose(p);
|
tsdbCacherowsReaderClose(p);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < p->pSchema->numOfCols; ++i) {
|
for (int32_t i = 0; i < p->pSchema->numOfCols; ++i) {
|
||||||
|
@ -446,7 +446,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
|
|
||||||
pRes = taosMemoryCalloc(pr->numOfCols, POINTER_BYTES);
|
pRes = taosMemoryCalloc(pr->numOfCols, POINTER_BYTES);
|
||||||
if (pRes == NULL) {
|
if (pRes == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
|
|
||||||
pRes[j] = taosMemoryCalloc(1, sizeof(SFirstLastRes) + bytes + pkBufLen + VARSTR_HEADER_SIZE);
|
pRes[j] = taosMemoryCalloc(1, sizeof(SFirstLastRes) + bytes + pkBufLen + VARSTR_HEADER_SIZE);
|
||||||
if (pRes[j] == NULL) {
|
if (pRes[j] == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
|
|
||||||
p.rowKey.pks[j].pData = taosMemoryCalloc(1, pr->pkColumn.bytes);
|
p.rowKey.pks[j].pData = taosMemoryCalloc(1, pr->pkColumn.bytes);
|
||||||
if (p.rowKey.pks[j].pData == NULL) {
|
if (p.rowKey.pks[j].pData == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
if (IS_VAR_DATA_TYPE(pCol->type)) {
|
if (IS_VAR_DATA_TYPE(pCol->type)) {
|
||||||
p.colVal.value.pData = taosMemoryCalloc(pCol->bytes, sizeof(char));
|
p.colVal.value.pData = taosMemoryCalloc(pCol->bytes, sizeof(char));
|
||||||
if (p.colVal.value.pData == NULL) {
|
if (p.colVal.value.pData == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -432,7 +432,7 @@ static int32_t tsdbCommitInfoInit(STsdb *pTsdb) {
|
||||||
|
|
||||||
pTsdb->commitInfo = taosMemoryCalloc(1, sizeof(*pTsdb->commitInfo));
|
pTsdb->commitInfo = taosMemoryCalloc(1, sizeof(*pTsdb->commitInfo));
|
||||||
if (pTsdb->commitInfo == NULL) {
|
if (pTsdb->commitInfo == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_CHECK_GOTO(vHashInit(&pTsdb->commitInfo->ht, tFileSetCommitInfoHash, tFileSetCommitInfoCompare), &lino, _exit);
|
TAOS_CHECK_GOTO(vHashInit(&pTsdb->commitInfo->ht, tFileSetCommitInfoHash, tFileSetCommitInfoCompare), &lino, _exit);
|
||||||
|
|
|
@ -23,7 +23,7 @@ int32_t tsdbDataFileRAWReaderOpen(const char *fname, const SDataFileRAWReaderCon
|
||||||
|
|
||||||
reader[0] = taosMemoryCalloc(1, sizeof(SDataFileRAWReader));
|
reader[0] = taosMemoryCalloc(1, sizeof(SDataFileRAWReader));
|
||||||
if (reader[0] == NULL) {
|
if (reader[0] == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
reader[0]->config[0] = config[0];
|
reader[0]->config[0] = config[0];
|
||||||
|
@ -94,7 +94,7 @@ int32_t tsdbDataFileRAWWriterOpen(const SDataFileRAWWriterConfig *config, SDataF
|
||||||
|
|
||||||
SDataFileRAWWriter *writer = taosMemoryCalloc(1, sizeof(SDataFileRAWWriter));
|
SDataFileRAWWriter *writer = taosMemoryCalloc(1, sizeof(SDataFileRAWWriter));
|
||||||
if (!writer) {
|
if (!writer) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
writer->config[0] = config[0];
|
writer->config[0] = config[0];
|
||||||
|
|
|
@ -111,7 +111,7 @@ int32_t tsdbDataFileReaderOpen(const char *fname[], const SDataFileReaderConfig
|
||||||
int32_t lino = 0;
|
int32_t lino = 0;
|
||||||
|
|
||||||
if ((*reader = taosMemoryCalloc(1, sizeof(**reader))) == NULL) {
|
if ((*reader = taosMemoryCalloc(1, sizeof(**reader))) == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < ARRAY_SIZE(reader[0]->local); i++) {
|
for (int32_t i = 0; i < ARRAY_SIZE(reader[0]->local); i++) {
|
||||||
|
@ -1801,7 +1801,7 @@ _exit:
|
||||||
int32_t tsdbDataFileWriterOpen(const SDataFileWriterConfig *config, SDataFileWriter **writer) {
|
int32_t tsdbDataFileWriterOpen(const SDataFileWriterConfig *config, SDataFileWriter **writer) {
|
||||||
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
||||||
if (!writer[0]) {
|
if (!writer[0]) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
writer[0]->config[0] = config[0];
|
writer[0]->config[0] = config[0];
|
||||||
|
|
|
@ -53,7 +53,7 @@ static int32_t tsdbBinaryToFS(uint8_t *pData, int64_t nData, STsdbFS *pFS) {
|
||||||
if (hasDel) {
|
if (hasDel) {
|
||||||
pFS->pDelFile = (SDelFile *)taosMemoryCalloc(1, sizeof(SDelFile));
|
pFS->pDelFile = (SDelFile *)taosMemoryCalloc(1, sizeof(SDelFile));
|
||||||
if (pFS->pDelFile == NULL) {
|
if (pFS->pDelFile == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ static const char *gCurrentFname[] = {
|
||||||
static int32_t create_fs(STsdb *pTsdb, STFileSystem **fs) {
|
static int32_t create_fs(STsdb *pTsdb, STFileSystem **fs) {
|
||||||
fs[0] = taosMemoryCalloc(1, sizeof(*fs[0]));
|
fs[0] = taosMemoryCalloc(1, sizeof(*fs[0]));
|
||||||
if (fs[0] == NULL) {
|
if (fs[0] == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs[0]->tsdb = pTsdb;
|
fs[0]->tsdb = pTsdb;
|
||||||
|
@ -417,7 +417,7 @@ static int32_t tsdbFSCreateFileObjHash(STFileSystem *fs, STFileHash *hash) {
|
||||||
hash->numBucket = 4096;
|
hash->numBucket = 4096;
|
||||||
hash->buckets = taosMemoryCalloc(hash->numBucket, sizeof(STFileHashEntry *));
|
hash->buckets = taosMemoryCalloc(hash->numBucket, sizeof(STFileHashEntry *));
|
||||||
if (hash->buckets == NULL) {
|
if (hash->buckets == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// vnode.json
|
// vnode.json
|
||||||
|
@ -1013,7 +1013,7 @@ int32_t tsdbFSCreateRefSnapshotWithoutLock(STFileSystem *fs, TFileSetArray **fse
|
||||||
STFileSet *fset, *fset1;
|
STFileSet *fset, *fset1;
|
||||||
|
|
||||||
fsetArr[0] = taosMemoryCalloc(1, sizeof(*fsetArr[0]));
|
fsetArr[0] = taosMemoryCalloc(1, sizeof(*fsetArr[0]));
|
||||||
if (fsetArr[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (fsetArr[0] == NULL) return terrno;
|
||||||
|
|
||||||
TARRAY2_FOREACH(fs->fSetArr, fset) {
|
TARRAY2_FOREACH(fs->fSetArr, fset) {
|
||||||
code = tsdbTFileSetInitRef(fs->tsdb, fset, &fset1);
|
code = tsdbTFileSetInitRef(fs->tsdb, fset, &fset1);
|
||||||
|
@ -1118,7 +1118,7 @@ int32_t tsdbFSCreateRefRangedSnapshot(STFileSystem *fs, int64_t sver, int64_t ev
|
||||||
|
|
||||||
fsrArr[0] = taosMemoryCalloc(1, sizeof(*fsrArr[0]));
|
fsrArr[0] = taosMemoryCalloc(1, sizeof(*fsrArr[0]));
|
||||||
if (fsrArr[0] == NULL) {
|
if (fsrArr[0] == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _out;
|
goto _out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ int32_t tsdbFSetRAWWriterOpen(SFSetRAWWriterConfig *config, SFSetRAWWriter **wri
|
||||||
|
|
||||||
writer[0] = taosMemoryCalloc(1, sizeof(SFSetRAWWriter));
|
writer[0] = taosMemoryCalloc(1, sizeof(SFSetRAWWriter));
|
||||||
if (writer[0] == NULL) {
|
if (writer[0] == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
writer[0]->config[0] = config[0];
|
writer[0]->config[0] = config[0];
|
||||||
|
|
|
@ -136,7 +136,7 @@ int32_t tsdbFSetWriterOpen(SFSetWriterConfig *config, SFSetWriter **writer) {
|
||||||
|
|
||||||
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
||||||
if (writer[0] == NULL) {
|
if (writer[0] == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
writer[0]->config[0] = config[0];
|
writer[0]->config[0] = config[0];
|
||||||
|
|
|
@ -181,7 +181,7 @@ int32_t tGetDFileSet(uint8_t *p, SDFileSet *pSet) {
|
||||||
// head
|
// head
|
||||||
pSet->pHeadF = (SHeadFile *)taosMemoryCalloc(1, sizeof(SHeadFile));
|
pSet->pHeadF = (SHeadFile *)taosMemoryCalloc(1, sizeof(SHeadFile));
|
||||||
if (pSet->pHeadF == NULL) {
|
if (pSet->pHeadF == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
pSet->pHeadF->nRef = 1;
|
pSet->pHeadF->nRef = 1;
|
||||||
n += tGetHeadFile(p + n, pSet->pHeadF);
|
n += tGetHeadFile(p + n, pSet->pHeadF);
|
||||||
|
@ -189,7 +189,7 @@ int32_t tGetDFileSet(uint8_t *p, SDFileSet *pSet) {
|
||||||
// data
|
// data
|
||||||
pSet->pDataF = (SDataFile *)taosMemoryCalloc(1, sizeof(SDataFile));
|
pSet->pDataF = (SDataFile *)taosMemoryCalloc(1, sizeof(SDataFile));
|
||||||
if (pSet->pDataF == NULL) {
|
if (pSet->pDataF == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
pSet->pDataF->nRef = 1;
|
pSet->pDataF->nRef = 1;
|
||||||
n += tGetDataFile(p + n, pSet->pDataF);
|
n += tGetDataFile(p + n, pSet->pDataF);
|
||||||
|
@ -197,7 +197,7 @@ int32_t tGetDFileSet(uint8_t *p, SDFileSet *pSet) {
|
||||||
// sma
|
// sma
|
||||||
pSet->pSmaF = (SSmaFile *)taosMemoryCalloc(1, sizeof(SSmaFile));
|
pSet->pSmaF = (SSmaFile *)taosMemoryCalloc(1, sizeof(SSmaFile));
|
||||||
if (pSet->pSmaF == NULL) {
|
if (pSet->pSmaF == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
pSet->pSmaF->nRef = 1;
|
pSet->pSmaF->nRef = 1;
|
||||||
n += tGetSmaFile(p + n, pSet->pSmaF);
|
n += tGetSmaFile(p + n, pSet->pSmaF);
|
||||||
|
@ -207,7 +207,7 @@ int32_t tGetDFileSet(uint8_t *p, SDFileSet *pSet) {
|
||||||
for (int32_t iStt = 0; iStt < pSet->nSttF; iStt++) {
|
for (int32_t iStt = 0; iStt < pSet->nSttF; iStt++) {
|
||||||
pSet->aSttF[iStt] = (SSttFile *)taosMemoryCalloc(1, sizeof(SSttFile));
|
pSet->aSttF[iStt] = (SSttFile *)taosMemoryCalloc(1, sizeof(SSttFile));
|
||||||
if (pSet->aSttF[iStt] == NULL) {
|
if (pSet->aSttF[iStt] == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
pSet->aSttF[iStt]->nRef = 1;
|
pSet->aSttF[iStt]->nRef = 1;
|
||||||
n += tGetSttFile(p + n, pSet->aSttF[iStt]);
|
n += tGetSttFile(p + n, pSet->aSttF[iStt]);
|
||||||
|
|
|
@ -50,7 +50,7 @@ int32_t tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *
|
||||||
// create handle
|
// create handle
|
||||||
pTsdb = (STsdb *)taosMemoryCalloc(1, sizeof(*pTsdb) + slen);
|
pTsdb = (STsdb *)taosMemoryCalloc(1, sizeof(*pTsdb) + slen);
|
||||||
if (pTsdb == NULL) {
|
if (pTsdb == NULL) {
|
||||||
TAOS_CHECK_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
pTsdb->path = (char *)&pTsdb[1];
|
pTsdb->path = (char *)&pTsdb[1];
|
||||||
|
|
|
@ -258,7 +258,7 @@ static int32_t initFilesetIterator(SFilesetIter* pIter, TFileSetArray* pFileSetA
|
||||||
if (pIter->pSttBlockReader == NULL) {
|
if (pIter->pSttBlockReader == NULL) {
|
||||||
pIter->pSttBlockReader = taosMemoryCalloc(1, sizeof(struct SSttBlockReader));
|
pIter->pSttBlockReader = taosMemoryCalloc(1, sizeof(struct SSttBlockReader));
|
||||||
if (pIter->pSttBlockReader == NULL) {
|
if (pIter->pSttBlockReader == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
tsdbError("failed to prepare the last block iterator, since:%s %s", tstrerror(code), pReader->idStr);
|
tsdbError("failed to prepare the last block iterator, since:%s %s", tstrerror(code), pReader->idStr);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -508,13 +508,13 @@ static int32_t initResBlockInfo(SResultBlockInfo* pResBlockInfo, int64_t capacit
|
||||||
if (IS_VAR_DATA_TYPE(pSup->pk.type)) {
|
if (IS_VAR_DATA_TYPE(pSup->pk.type)) {
|
||||||
p->info.pks[0].pData = taosMemoryCalloc(1, pSup->pk.bytes);
|
p->info.pks[0].pData = taosMemoryCalloc(1, pSup->pk.bytes);
|
||||||
if (p->info.pks[0].pData == NULL) {
|
if (p->info.pks[0].pData == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->info.pks[1].pData = taosMemoryCalloc(1, pSup->pk.bytes);
|
p->info.pks[1].pData = taosMemoryCalloc(1, pSup->pk.bytes);
|
||||||
if (p->info.pks[1].pData == NULL) {
|
if (p->info.pks[1].pData == NULL) {
|
||||||
taosMemoryFreeClear(p->info.pks[0].pData);
|
taosMemoryFreeClear(p->info.pks[0].pData);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->info.pks[0].nData = pSup->pk.bytes;
|
p->info.pks[0].nData = pSup->pk.bytes;
|
||||||
|
@ -534,7 +534,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, void
|
||||||
int8_t level = 0;
|
int8_t level = 0;
|
||||||
STsdbReader* pReader = (STsdbReader*)taosMemoryCalloc(1, sizeof(*pReader));
|
STsdbReader* pReader = (STsdbReader*)taosMemoryCalloc(1, sizeof(*pReader));
|
||||||
if (pReader == NULL) {
|
if (pReader == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5384,7 +5384,7 @@ int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock,
|
||||||
size_t num = taosArrayGetSize(pResBlock->pDataBlock);
|
size_t num = taosArrayGetSize(pResBlock->pDataBlock);
|
||||||
pResBlock->pBlockAgg = taosMemoryCalloc(num, sizeof(SColumnDataAgg));
|
pResBlock->pBlockAgg = taosMemoryCalloc(num, sizeof(SColumnDataAgg));
|
||||||
if (pResBlock->pBlockAgg == NULL) {
|
if (pResBlock->pBlockAgg == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < num; ++i) {
|
for (int i = 0; i < num; ++i) {
|
||||||
pResBlock->pBlockAgg[i].colId = -1;
|
pResBlock->pBlockAgg[i].colId = -1;
|
||||||
|
|
|
@ -38,7 +38,7 @@ static int32_t initBlockScanInfoBuf(SBlockInfoBuf* pBuf, int32_t numOfTables) {
|
||||||
for (int32_t i = 0; i < num; ++i) {
|
for (int32_t i = 0; i < num; ++i) {
|
||||||
char* p = taosMemoryCalloc(pBuf->numPerBucket, sizeof(STableBlockScanInfo));
|
char* p = taosMemoryCalloc(pBuf->numPerBucket, sizeof(STableBlockScanInfo));
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* px = taosArrayPush(pBuf->pData, &p);
|
void* px = taosArrayPush(pBuf->pData, &p);
|
||||||
|
@ -50,7 +50,7 @@ static int32_t initBlockScanInfoBuf(SBlockInfoBuf* pBuf, int32_t numOfTables) {
|
||||||
if (remainder > 0) {
|
if (remainder > 0) {
|
||||||
char* p = taosMemoryCalloc(remainder, sizeof(STableBlockScanInfo));
|
char* p = taosMemoryCalloc(remainder, sizeof(STableBlockScanInfo));
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
void* px = taosArrayPush(pBuf->pData, &p);
|
void* px = taosArrayPush(pBuf->pData, &p);
|
||||||
if (px == NULL) {
|
if (px == NULL) {
|
||||||
|
@ -96,7 +96,7 @@ int32_t ensureBlockScanInfoBuf(SBlockInfoBuf* pBuf, int32_t numOfTables) {
|
||||||
for (int32_t i = 0; i < num; ++i) {
|
for (int32_t i = 0; i < num; ++i) {
|
||||||
char* p = taosMemoryCalloc(pBuf->numPerBucket, sizeof(STableBlockScanInfo));
|
char* p = taosMemoryCalloc(pBuf->numPerBucket, sizeof(STableBlockScanInfo));
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* px = taosArrayPush(pBuf->pData, &p);
|
void* px = taosArrayPush(pBuf->pData, &p);
|
||||||
|
@ -108,7 +108,7 @@ int32_t ensureBlockScanInfoBuf(SBlockInfoBuf* pBuf, int32_t numOfTables) {
|
||||||
if (remainder > 0) {
|
if (remainder > 0) {
|
||||||
char* p = taosMemoryCalloc(remainder, sizeof(STableBlockScanInfo));
|
char* p = taosMemoryCalloc(remainder, sizeof(STableBlockScanInfo));
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
void* px = taosArrayPush(pBuf->pData, &p);
|
void* px = taosArrayPush(pBuf->pData, &p);
|
||||||
if (px == NULL) {
|
if (px == NULL) {
|
||||||
|
@ -231,7 +231,6 @@ int32_t initRowKey(SRowKey* pKey, int64_t ts, int32_t numOfPks, int32_t type, in
|
||||||
pKey->pks[0].nData = 0;
|
pKey->pks[0].nData = 0;
|
||||||
|
|
||||||
if (pKey->pks[0].pData == NULL) {
|
if (pKey->pks[0].pData == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,12 +525,22 @@ static void cleanupBlockOrderSupporter(SBlockOrderSupporter* pSup) {
|
||||||
|
|
||||||
static int32_t initBlockOrderSupporter(SBlockOrderSupporter* pSup, int32_t numOfTables) {
|
static int32_t initBlockOrderSupporter(SBlockOrderSupporter* pSup, int32_t numOfTables) {
|
||||||
pSup->numOfBlocksPerTable = taosMemoryCalloc(1, sizeof(int32_t) * numOfTables);
|
pSup->numOfBlocksPerTable = taosMemoryCalloc(1, sizeof(int32_t) * numOfTables);
|
||||||
pSup->indexPerTable = taosMemoryCalloc(1, sizeof(int32_t) * numOfTables);
|
if(pSup->numOfBlocksPerTable == NULL) {
|
||||||
pSup->pDataBlockInfo = taosMemoryCalloc(1, POINTER_BYTES * numOfTables);
|
|
||||||
|
|
||||||
if (pSup->numOfBlocksPerTable == NULL || pSup->indexPerTable == NULL || pSup->pDataBlockInfo == NULL) {
|
|
||||||
cleanupBlockOrderSupporter(pSup);
|
cleanupBlockOrderSupporter(pSup);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
|
}
|
||||||
|
pSup->indexPerTable = taosMemoryCalloc(1, sizeof(int32_t) * numOfTables);
|
||||||
|
if(pSup->indexPerTable == NULL) {
|
||||||
|
taosMemoryFree(pSup->numOfBlocksPerTable);
|
||||||
|
cleanupBlockOrderSupporter(pSup);
|
||||||
|
return terrno;
|
||||||
|
}
|
||||||
|
pSup->pDataBlockInfo = taosMemoryCalloc(1, POINTER_BYTES * numOfTables);
|
||||||
|
if (pSup->pDataBlockInfo == NULL) {
|
||||||
|
cleanupBlockOrderSupporter(pSup);
|
||||||
|
taosMemoryFree(pSup->numOfBlocksPerTable);
|
||||||
|
taosMemoryFree(pSup->indexPerTable);
|
||||||
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
|
|
@ -60,7 +60,7 @@ static int32_t tsdbOpenFileImpl(STsdbFD *pFD) {
|
||||||
|
|
||||||
pFD->pBuf = taosMemoryCalloc(1, szPage);
|
pFD->pBuf = taosMemoryCalloc(1, szPage);
|
||||||
if (pFD->pBuf == NULL) {
|
if (pFD->pBuf == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lc_size > 0) {
|
if (lc_size > 0) {
|
||||||
|
@ -100,7 +100,7 @@ int32_t tsdbOpenFile(const char *path, STsdb *pTsdb, int32_t flag, STsdbFD **ppF
|
||||||
|
|
||||||
pFD = (STsdbFD *)taosMemoryCalloc(1, sizeof(*pFD) + strlen(path) + 1);
|
pFD = (STsdbFD *)taosMemoryCalloc(1, sizeof(*pFD) + strlen(path) + 1);
|
||||||
if (pFD == NULL) {
|
if (pFD == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
pFD->path = (char *)&pFD[1];
|
pFD->path = (char *)&pFD[1];
|
||||||
|
@ -363,7 +363,7 @@ static int32_t tsdbReadFileBlock(STsdbFD *pFD, int64_t offset, int64_t size, boo
|
||||||
|
|
||||||
buf = taosMemoryCalloc(1, size);
|
buf = taosMemoryCalloc(1, size);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t chunkno = offset / chunksize + 1; n < size; ++chunkno) {
|
for (int32_t chunkno = offset / chunksize + 1; n < size; ++chunkno) {
|
||||||
|
@ -587,7 +587,7 @@ int32_t tsdbDataFReaderOpen(SDataFReader **ppReader, STsdb *pTsdb, SDFileSet *pS
|
||||||
// alloc
|
// alloc
|
||||||
pReader = (SDataFReader *)taosMemoryCalloc(1, sizeof(*pReader));
|
pReader = (SDataFReader *)taosMemoryCalloc(1, sizeof(*pReader));
|
||||||
if (pReader == NULL) {
|
if (pReader == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
pReader->pTsdb = pTsdb;
|
pReader->pTsdb = pTsdb;
|
||||||
pReader->pSet = pSet;
|
pReader->pSet = pSet;
|
||||||
|
@ -794,7 +794,7 @@ int32_t tsdbDelFReaderOpen(SDelFReader **ppReader, SDelFile *pFile, STsdb *pTsdb
|
||||||
// alloc
|
// alloc
|
||||||
pDelFReader = (SDelFReader *)taosMemoryCalloc(1, sizeof(*pDelFReader));
|
pDelFReader = (SDelFReader *)taosMemoryCalloc(1, sizeof(*pDelFReader));
|
||||||
if (pDelFReader == NULL) {
|
if (pDelFReader == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// open impl
|
// open impl
|
||||||
|
|
|
@ -416,7 +416,7 @@ int32_t tsdbSnapReaderOpen(STsdb* tsdb, int64_t sver, int64_t ever, int8_t type,
|
||||||
int32_t lino = 0;
|
int32_t lino = 0;
|
||||||
|
|
||||||
reader[0] = (STsdbSnapReader*)taosMemoryCalloc(1, sizeof(*reader[0]));
|
reader[0] = (STsdbSnapReader*)taosMemoryCalloc(1, sizeof(*reader[0]));
|
||||||
if (reader[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (reader[0] == NULL) return terrno;
|
||||||
|
|
||||||
reader[0]->tsdb = tsdb;
|
reader[0]->tsdb = tsdb;
|
||||||
reader[0]->sver = sver;
|
reader[0]->sver = sver;
|
||||||
|
@ -1047,7 +1047,7 @@ int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, void* pRang
|
||||||
|
|
||||||
// start to write
|
// start to write
|
||||||
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
||||||
if (writer[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (writer[0] == NULL) return terrno;
|
||||||
|
|
||||||
writer[0]->tsdb = pTsdb;
|
writer[0]->tsdb = pTsdb;
|
||||||
writer[0]->sver = sver;
|
writer[0]->sver = sver;
|
||||||
|
|
|
@ -52,7 +52,7 @@ int32_t tsdbSnapRAWReaderOpen(STsdb* tsdb, int64_t ever, int8_t type, STsdbSnapR
|
||||||
int32_t lino = 0;
|
int32_t lino = 0;
|
||||||
|
|
||||||
reader[0] = taosMemoryCalloc(1, sizeof(STsdbSnapRAWReader));
|
reader[0] = taosMemoryCalloc(1, sizeof(STsdbSnapRAWReader));
|
||||||
if (reader[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (reader[0] == NULL) return terrno;
|
||||||
|
|
||||||
reader[0]->tsdb = tsdb;
|
reader[0]->tsdb = tsdb;
|
||||||
reader[0]->ever = ever;
|
reader[0]->ever = ever;
|
||||||
|
@ -196,7 +196,7 @@ static int32_t tsdbSnapRAWReadNext(STsdbSnapRAWReader* reader, SSnapDataHdr** pp
|
||||||
|
|
||||||
void* pBuf = taosMemoryCalloc(1, sizeof(SSnapDataHdr) + sizeof(STsdbDataRAWBlockHeader) + dataLength);
|
void* pBuf = taosMemoryCalloc(1, sizeof(SSnapDataHdr) + sizeof(STsdbDataRAWBlockHeader) + dataLength);
|
||||||
if (pBuf == NULL) {
|
if (pBuf == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
SSnapDataHdr* pHdr = pBuf;
|
SSnapDataHdr* pHdr = pBuf;
|
||||||
|
@ -343,7 +343,7 @@ int32_t tsdbSnapRAWWriterOpen(STsdb* pTsdb, int64_t ever, STsdbSnapRAWWriter** w
|
||||||
|
|
||||||
// start to write
|
// start to write
|
||||||
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
||||||
if (writer[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (writer[0] == NULL) return terrno;
|
||||||
|
|
||||||
writer[0]->tsdb = pTsdb;
|
writer[0]->tsdb = pTsdb;
|
||||||
writer[0]->ever = ever;
|
writer[0]->ever = ever;
|
||||||
|
|
|
@ -41,7 +41,7 @@ int32_t tsdbSttFileReaderOpen(const char *fname, const SSttFileReaderConfig *con
|
||||||
|
|
||||||
reader[0] = taosMemoryCalloc(1, sizeof(*reader[0]));
|
reader[0] = taosMemoryCalloc(1, sizeof(*reader[0]));
|
||||||
if (reader[0] == NULL) {
|
if (reader[0] == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
reader[0]->config[0] = config[0];
|
reader[0]->config[0] = config[0];
|
||||||
|
@ -897,7 +897,7 @@ static int32_t tsdbSttFWriterCloseAbort(SSttFileWriter *writer) {
|
||||||
int32_t tsdbSttFileWriterOpen(const SSttFileWriterConfig *config, SSttFileWriter **writer) {
|
int32_t tsdbSttFileWriterOpen(const SSttFileWriterConfig *config, SSttFileWriter **writer) {
|
||||||
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
writer[0] = taosMemoryCalloc(1, sizeof(*writer[0]));
|
||||||
if (writer[0] == NULL) {
|
if (writer[0] == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
writer[0]->config[0] = config[0];
|
writer[0]->config[0] = config[0];
|
||||||
|
|
|
@ -326,7 +326,7 @@ static int32_t vnodeAsyncInit(SVAsync **async, const char *label) {
|
||||||
|
|
||||||
(*async) = (SVAsync *)taosMemoryCalloc(1, sizeof(SVAsync) + strlen(label) + 1);
|
(*async) = (SVAsync *)taosMemoryCalloc(1, sizeof(SVAsync) + strlen(label) + 1);
|
||||||
if ((*async) == NULL) {
|
if ((*async) == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy((char *)((*async) + 1), label);
|
strcpy((char *)((*async) + 1), label);
|
||||||
|
@ -480,7 +480,7 @@ int32_t vnodeAsync(SVAChannelID *channelID, EVAPriority priority, int32_t (*exec
|
||||||
// create task object
|
// create task object
|
||||||
SVATask *task = (SVATask *)taosMemoryCalloc(1, sizeof(SVATask));
|
SVATask *task = (SVATask *)taosMemoryCalloc(1, sizeof(SVATask));
|
||||||
if (task == NULL) {
|
if (task == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
task->priority = priority;
|
task->priority = priority;
|
||||||
|
|
|
@ -372,7 +372,7 @@ int vnodeAsyncCommit(SVnode *pVnode) {
|
||||||
|
|
||||||
SCommitInfo *pInfo = (SCommitInfo *)taosMemoryCalloc(1, sizeof(*pInfo));
|
SCommitInfo *pInfo = (SCommitInfo *)taosMemoryCalloc(1, sizeof(*pInfo));
|
||||||
if (NULL == pInfo) {
|
if (NULL == pInfo) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare to commit
|
// prepare to commit
|
||||||
|
|
|
@ -27,7 +27,7 @@ struct SVHashEntry {
|
||||||
static int32_t vHashRehash(SVHashTable* ht, uint32_t newNumBuckets) {
|
static int32_t vHashRehash(SVHashTable* ht, uint32_t newNumBuckets) {
|
||||||
SVHashEntry** newBuckets = (SVHashEntry**)taosMemoryCalloc(newNumBuckets, sizeof(SVHashEntry*));
|
SVHashEntry** newBuckets = (SVHashEntry**)taosMemoryCalloc(newNumBuckets, sizeof(SVHashEntry*));
|
||||||
if (newBuckets == NULL) {
|
if (newBuckets == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < ht->numBuckets; i++) {
|
for (int32_t i = 0; i < ht->numBuckets; i++) {
|
||||||
|
@ -65,7 +65,7 @@ int32_t vHashInit(SVHashTable** ht, uint32_t (*hash)(const void*), int32_t (*com
|
||||||
(*ht)->buckets = (SVHashEntry**)taosMemoryCalloc((*ht)->numBuckets, sizeof(SVHashEntry*));
|
(*ht)->buckets = (SVHashEntry**)taosMemoryCalloc((*ht)->numBuckets, sizeof(SVHashEntry*));
|
||||||
if ((*ht)->buckets == NULL) {
|
if ((*ht)->buckets == NULL) {
|
||||||
taosMemoryFree(*ht);
|
taosMemoryFree(*ht);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -118,7 +118,7 @@ int32_t vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
||||||
metaRsp.pSchemas = (SSchema *)taosMemoryMalloc(sizeof(SSchema) * (metaRsp.numOfColumns + metaRsp.numOfTags));
|
metaRsp.pSchemas = (SSchema *)taosMemoryMalloc(sizeof(SSchema) * (metaRsp.numOfColumns + metaRsp.numOfTags));
|
||||||
metaRsp.pSchemaExt = (SSchemaExt *)taosMemoryCalloc(metaRsp.numOfColumns, sizeof(SSchemaExt));
|
metaRsp.pSchemaExt = (SSchemaExt *)taosMemoryCalloc(metaRsp.numOfColumns, sizeof(SSchemaExt));
|
||||||
if (NULL == metaRsp.pSchemas || NULL == metaRsp.pSchemaExt) {
|
if (NULL == metaRsp.pSchemas || NULL == metaRsp.pSchemaExt) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
(void)memcpy(metaRsp.pSchemas, schema.pSchema, sizeof(SSchema) * schema.nCols);
|
(void)memcpy(metaRsp.pSchemas, schema.pSchema, sizeof(SSchema) * schema.nCols);
|
||||||
|
@ -151,7 +151,7 @@ int32_t vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pRsp == NULL) {
|
if (pRsp == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ int32_t vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pRsp == NULL) {
|
if (pRsp == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -870,7 +870,7 @@ int32_t vnodeGetStreamProgress(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
||||||
buf = taosMemoryCalloc(1, rspLen);
|
buf = taosMemoryCalloc(1, rspLen);
|
||||||
}
|
}
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ int32_t vnodeSnapReaderOpen(SVnode *pVnode, SSnapshotParam *pParam, SVSnapReader
|
||||||
|
|
||||||
pReader = (SVSnapReader *)taosMemoryCalloc(1, sizeof(*pReader));
|
pReader = (SVSnapReader *)taosMemoryCalloc(1, sizeof(*pReader));
|
||||||
if (pReader == NULL) {
|
if (pReader == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
pReader->pVnode = pVnode;
|
pReader->pVnode = pVnode;
|
||||||
|
@ -617,7 +617,7 @@ int32_t vnodeSnapWriterOpen(SVnode *pVnode, SSnapshotParam *pParam, SVSnapWriter
|
||||||
// alloc
|
// alloc
|
||||||
pWriter = (SVSnapWriter *)taosMemoryCalloc(1, sizeof(*pWriter));
|
pWriter = (SVSnapWriter *)taosMemoryCalloc(1, sizeof(*pWriter));
|
||||||
if (pWriter == NULL) {
|
if (pWriter == NULL) {
|
||||||
TSDB_CHECK_CODE(code = TSDB_CODE_OUT_OF_MEMORY, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
pWriter->pVnode = pVnode;
|
pWriter->pVnode = pVnode;
|
||||||
pWriter->sver = sver;
|
pWriter->sver = sver;
|
||||||
|
|
|
@ -1525,7 +1525,7 @@ static int32_t vnodeResetTableCxt(SMeta *pMeta, SSubmitReqConvertCxt *pCxt) {
|
||||||
if (NULL == pCxt->pTbData) {
|
if (NULL == pCxt->pTbData) {
|
||||||
pCxt->pTbData = taosMemoryCalloc(1, sizeof(SSubmitTbData));
|
pCxt->pTbData = taosMemoryCalloc(1, sizeof(SSubmitTbData));
|
||||||
if (NULL == pCxt->pTbData) {
|
if (NULL == pCxt->pTbData) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pCxt->pTbData->flags = 0;
|
pCxt->pTbData->flags = 0;
|
||||||
|
@ -1608,7 +1608,7 @@ static int32_t vnodeDecodeCreateTbReq(SSubmitReqConvertCxt *pCxt) {
|
||||||
|
|
||||||
pCxt->pTbData->pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
pCxt->pTbData->pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
||||||
if (NULL == pCxt->pTbData->pCreateTbReq) {
|
if (NULL == pCxt->pTbData->pCreateTbReq) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDecoder decoder = {0};
|
SDecoder decoder = {0};
|
||||||
|
|
Loading…
Reference in New Issue