fix: return code issues
This commit is contained in:
parent
d7032ac520
commit
2bd493f77b
|
@ -63,7 +63,7 @@ typedef struct SFuncExecFuncs {
|
||||||
processFuncByRow processFuncByRow;
|
processFuncByRow processFuncByRow;
|
||||||
} SFuncExecFuncs;
|
} SFuncExecFuncs;
|
||||||
|
|
||||||
#define MAX_INTERVAL_TIME_WINDOW 1000000000 // maximum allowed time windows in final results
|
#define MAX_INTERVAL_TIME_WINDOW 10000000 // maximum allowed time windows in final results
|
||||||
|
|
||||||
#define TOP_BOTTOM_QUERY_LIMIT 100
|
#define TOP_BOTTOM_QUERY_LIMIT 100
|
||||||
#define FUNCTIONS_NAME_MAX_LENGTH 32
|
#define FUNCTIONS_NAME_MAX_LENGTH 32
|
||||||
|
|
|
@ -955,7 +955,7 @@ void taos_init_imp(void) {
|
||||||
taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_ENTRY_LOCK);
|
taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_ENTRY_LOCK);
|
||||||
if (NULL == appInfo.pInstMap || NULL == appInfo.pInstMapByClusterId) {
|
if (NULL == appInfo.pInstMap || NULL == appInfo.pInstMapByClusterId) {
|
||||||
(void)printf("failed to allocate memory when init appInfo\n");
|
(void)printf("failed to allocate memory when init appInfo\n");
|
||||||
tscInitRes = TSDB_CODE_OUT_OF_MEMORY;
|
tscInitRes = terrno;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
taosHashSetFreeFp(appInfo.pInstMap, destroyAppInst);
|
taosHashSetFreeFp(appInfo.pInstMap, destroyAppInst);
|
||||||
|
|
|
@ -1339,7 +1339,6 @@ static void *hbThreadFunc(void *param) {
|
||||||
}
|
}
|
||||||
void *buf = taosMemoryMalloc(tlen);
|
void *buf = taosMemoryMalloc(tlen);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
tFreeClientHbBatchReq(pReq);
|
tFreeClientHbBatchReq(pReq);
|
||||||
// hbClearReqInfo(pAppHbMgr);
|
// hbClearReqInfo(pAppHbMgr);
|
||||||
break;
|
break;
|
||||||
|
@ -1353,7 +1352,6 @@ static void *hbThreadFunc(void *param) {
|
||||||
SMsgSendInfo *pInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
SMsgSendInfo *pInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
||||||
|
|
||||||
if (pInfo == NULL) {
|
if (pInfo == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
tFreeClientHbBatchReq(pReq);
|
tFreeClientHbBatchReq(pReq);
|
||||||
// hbClearReqInfo(pAppHbMgr);
|
// hbClearReqInfo(pAppHbMgr);
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
|
@ -1365,7 +1363,6 @@ static void *hbThreadFunc(void *param) {
|
||||||
pInfo->msgType = TDMT_MND_HEARTBEAT;
|
pInfo->msgType = TDMT_MND_HEARTBEAT;
|
||||||
pInfo->param = taosMemoryMalloc(sizeof(int32_t));
|
pInfo->param = taosMemoryMalloc(sizeof(int32_t));
|
||||||
if (pInfo->param == NULL) {
|
if (pInfo->param == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
tFreeClientHbBatchReq(pReq);
|
tFreeClientHbBatchReq(pReq);
|
||||||
// hbClearReqInfo(pAppHbMgr);
|
// hbClearReqInfo(pAppHbMgr);
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
|
@ -1459,7 +1456,7 @@ int32_t appHbMgrInit(SAppInstInfo *pAppInstInfo, char *key, SAppHbMgr **pAppHbMg
|
||||||
(*pAppHbMgr)->reportBytes = 0;
|
(*pAppHbMgr)->reportBytes = 0;
|
||||||
(*pAppHbMgr)->key = taosStrdup(key);
|
(*pAppHbMgr)->key = taosStrdup(key);
|
||||||
if ((*pAppHbMgr)->key == NULL) {
|
if ((*pAppHbMgr)->key == NULL) {
|
||||||
TSC_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
TSC_ERR_JRET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
// init app info
|
// init app info
|
||||||
|
|
|
@ -126,7 +126,7 @@ int32_t taos_connect_internal(const char* ip, const char* user, const char* pass
|
||||||
|
|
||||||
char* key = getClusterKey(user, secretEncrypt, ip, port);
|
char* key = getClusterKey(user, secretEncrypt, ip, port);
|
||||||
if (NULL == key) {
|
if (NULL == key) {
|
||||||
TSC_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
TSC_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
tscInfo("connecting to server, numOfEps:%d inUse:%d user:%s db:%s key:%s", epSet.epSet.numOfEps, epSet.epSet.inUse,
|
tscInfo("connecting to server, numOfEps:%d inUse:%d user:%s db:%s key:%s", epSet.epSet.numOfEps, epSet.epSet.inUse,
|
||||||
user, db, key);
|
user, db, key);
|
||||||
|
@ -1820,11 +1820,10 @@ int32_t doProcessMsgFromServerImpl(SRpcMsg* pMsg, SEpSet* pEpSet) {
|
||||||
.handleRefId = pMsg->info.refId,
|
.handleRefId = pMsg->info.refId,
|
||||||
.pEpSet = pEpSet};
|
.pEpSet = pEpSet};
|
||||||
|
|
||||||
if (pMsg->code != TSDB_CODE_OUT_OF_MEMORY && pMsg->contLen > 0) {
|
if (pMsg->contLen > 0) {
|
||||||
buf.pData = taosMemoryCalloc(1, pMsg->contLen);
|
buf.pData = taosMemoryCalloc(1, pMsg->contLen);
|
||||||
if (buf.pData == NULL) {
|
if (buf.pData == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
pMsg->code = terrno;
|
||||||
pMsg->code = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
} else {
|
} else {
|
||||||
(void)memcpy(buf.pData, pMsg->pCont, pMsg->contLen);
|
(void)memcpy(buf.pData, pMsg->pCont, pMsg->contLen);
|
||||||
}
|
}
|
||||||
|
@ -2957,7 +2956,6 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly, int8_t s
|
||||||
|
|
||||||
SSyncQueryParam* param = taosMemoryCalloc(1, sizeof(SSyncQueryParam));
|
SSyncQueryParam* param = taosMemoryCalloc(1, sizeof(SSyncQueryParam));
|
||||||
if (NULL == param) {
|
if (NULL == param) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int32_t code = tsem_init(¶m->sem, 0, 0);
|
int32_t code = tsem_init(¶m->sem, 0, 0);
|
||||||
|
@ -2998,7 +2996,6 @@ TAOS_RES* taosQueryImplWithReqid(TAOS* taos, const char* sql, bool validateOnly,
|
||||||
|
|
||||||
SSyncQueryParam* param = taosMemoryCalloc(1, sizeof(SSyncQueryParam));
|
SSyncQueryParam* param = taosMemoryCalloc(1, sizeof(SSyncQueryParam));
|
||||||
if (param == NULL) {
|
if (param == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int32_t code = tsem_init(¶m->sem, 0, 0);
|
int32_t code = tsem_init(¶m->sem, 0, 0);
|
||||||
|
|
|
@ -292,7 +292,6 @@ TAOS *taos_connect(const char *ip, const char *user, const char *pass, const cha
|
||||||
int64_t *rid = taosMemoryCalloc(1, sizeof(int64_t));
|
int64_t *rid = taosMemoryCalloc(1, sizeof(int64_t));
|
||||||
if (NULL == rid) {
|
if (NULL == rid) {
|
||||||
tscError("out of memory when taos connect to %s:%u, user:%s db:%s", ip, port, user, db);
|
tscError("out of memory when taos connect to %s:%u, user:%s db:%s", ip, port, user, db);
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
*rid = pObj->id;
|
*rid = pObj->id;
|
||||||
|
@ -424,7 +423,7 @@ void taos_fetch_whitelist_a(TAOS *taos, __taos_async_whitelist_fn_t fp, void *pa
|
||||||
|
|
||||||
void *pReq = taosMemoryMalloc(msgLen);
|
void *pReq = taosMemoryMalloc(msgLen);
|
||||||
if (pReq == NULL) {
|
if (pReq == NULL) {
|
||||||
fp(param, TSDB_CODE_OUT_OF_MEMORY, taos, 0, NULL);
|
fp(param, terrno, taos, 0, NULL);
|
||||||
releaseTscObj(connId);
|
releaseTscObj(connId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -438,7 +437,7 @@ void taos_fetch_whitelist_a(TAOS *taos, __taos_async_whitelist_fn_t fp, void *pa
|
||||||
|
|
||||||
SFetchWhiteListInfo *pParam = taosMemoryMalloc(sizeof(SFetchWhiteListInfo));
|
SFetchWhiteListInfo *pParam = taosMemoryMalloc(sizeof(SFetchWhiteListInfo));
|
||||||
if (pParam == NULL) {
|
if (pParam == NULL) {
|
||||||
fp(param, TSDB_CODE_OUT_OF_MEMORY, taos, 0, NULL);
|
fp(param, terrno, taos, 0, NULL);
|
||||||
taosMemoryFree(pReq);
|
taosMemoryFree(pReq);
|
||||||
releaseTscObj(connId);
|
releaseTscObj(connId);
|
||||||
return;
|
return;
|
||||||
|
@ -449,7 +448,7 @@ void taos_fetch_whitelist_a(TAOS *taos, __taos_async_whitelist_fn_t fp, void *pa
|
||||||
pParam->userParam = param;
|
pParam->userParam = param;
|
||||||
SMsgSendInfo *pSendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
SMsgSendInfo *pSendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
||||||
if (pSendInfo == NULL) {
|
if (pSendInfo == NULL) {
|
||||||
fp(param, TSDB_CODE_OUT_OF_MEMORY, taos, 0, NULL);
|
fp(param, terrno, taos, 0, NULL);
|
||||||
taosMemoryFree(pParam);
|
taosMemoryFree(pParam);
|
||||||
taosMemoryFree(pReq);
|
taosMemoryFree(pReq);
|
||||||
releaseTscObj(connId);
|
releaseTscObj(connId);
|
||||||
|
|
|
@ -1563,7 +1563,7 @@ static int32_t taosAlterTable(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
req.source = TD_REQ_FROM_TAOX;
|
req.source = TD_REQ_FROM_TAOX;
|
||||||
tEncodeSize(tEncodeSVAlterTbReq, &req, tlen, code);
|
tEncodeSize(tEncodeSVAlterTbReq, &req, tlen, code);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
tlen += sizeof(SMsgHead);
|
tlen += sizeof(SMsgHead);
|
||||||
|
@ -1577,7 +1577,7 @@ static int32_t taosAlterTable(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
code = tEncodeSVAlterTbReq(&coder, &req);
|
code = tEncodeSVAlterTbReq(&coder, &req);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
tEncoderClear(&coder);
|
tEncoderClear(&coder);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
tEncoderClear(&coder);
|
tEncoderClear(&coder);
|
||||||
|
|
|
@ -134,7 +134,7 @@ int32_t smlParseValue(SSmlKv *pVal, SSmlMsgBuf *msg) {
|
||||||
void* data = NULL;
|
void* data = NULL;
|
||||||
uint32_t size = 0;
|
uint32_t size = 0;
|
||||||
if(taosHex2Ascii(pVal->value + NCHAR_ADD_LEN - 1, pVal->length - NCHAR_ADD_LEN, &data, &size) < 0){
|
if(taosHex2Ascii(pVal->value + NCHAR_ADD_LEN - 1, pVal->length - NCHAR_ADD_LEN, &data, &size) < 0){
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size + VARSTR_HEADER_SIZE > TSDB_MAX_VARBINARY_LEN) {
|
if (size + VARSTR_HEADER_SIZE > TSDB_MAX_VARBINARY_LEN) {
|
||||||
|
|
|
@ -300,7 +300,7 @@ int32_t stmtCacheBlock(STscStmt* pStmt) {
|
||||||
|
|
||||||
STableDataCxt** pSrc = taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
STableDataCxt** pSrc = taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
||||||
if (!pSrc) {
|
if (!pSrc) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
STableDataCxt* pDst = NULL;
|
STableDataCxt* pDst = NULL;
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ int32_t stmtParseSql(STscStmt* pStmt) {
|
||||||
STableDataCxt** pSrc =
|
STableDataCxt** pSrc =
|
||||||
(STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
(STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
||||||
if (NULL == pSrc || NULL == *pSrc) {
|
if (NULL == pSrc || NULL == *pSrc) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
STableDataCxt* pTableCtx = *pSrc;
|
STableDataCxt* pTableCtx = *pSrc;
|
||||||
|
@ -845,13 +845,11 @@ TAOS_STMT* stmtInit(STscObj* taos, int64_t reqid, TAOS_STMT_OPTIONS* pOptions) {
|
||||||
|
|
||||||
pStmt = taosMemoryCalloc(1, sizeof(STscStmt));
|
pStmt = taosMemoryCalloc(1, sizeof(STscStmt));
|
||||||
if (NULL == pStmt) {
|
if (NULL == pStmt) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pStmt->sql.pTableCache = taosHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
|
pStmt->sql.pTableCache = taosHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
|
||||||
if (NULL == pStmt->sql.pTableCache) {
|
if (NULL == pStmt->sql.pTableCache) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
taosMemoryFree(pStmt);
|
taosMemoryFree(pStmt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -876,13 +874,11 @@ TAOS_STMT* stmtInit(STscObj* taos, int64_t reqid, TAOS_STMT_OPTIONS* pOptions) {
|
||||||
pStmt->sql.siInfo.mgmtEpSet = getEpSet_s(&pStmt->taos->pAppInfo->mgmtEp);
|
pStmt->sql.siInfo.mgmtEpSet = getEpSet_s(&pStmt->taos->pAppInfo->mgmtEp);
|
||||||
pStmt->sql.siInfo.pTableHash = tSimpleHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY));
|
pStmt->sql.siInfo.pTableHash = tSimpleHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY));
|
||||||
if (NULL == pStmt->sql.siInfo.pTableHash) {
|
if (NULL == pStmt->sql.siInfo.pTableHash) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
(void)stmtClose(pStmt);
|
(void)stmtClose(pStmt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
pStmt->sql.siInfo.pTableCols = taosArrayInit(STMT_TABLE_COLS_NUM, POINTER_BYTES);
|
pStmt->sql.siInfo.pTableCols = taosArrayInit(STMT_TABLE_COLS_NUM, POINTER_BYTES);
|
||||||
if (NULL == pStmt->sql.siInfo.pTableCols) {
|
if (NULL == pStmt->sql.siInfo.pTableCols) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
(void)stmtClose(pStmt);
|
(void)stmtClose(pStmt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -948,7 +944,7 @@ int stmtPrepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
|
||||||
int32_t stmtInitStbInterlaceTableInfo(STscStmt* pStmt) {
|
int32_t stmtInitStbInterlaceTableInfo(STscStmt* pStmt) {
|
||||||
STableDataCxt** pSrc = taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
STableDataCxt** pSrc = taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
||||||
if (!pSrc) {
|
if (!pSrc) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
STableDataCxt* pDst = NULL;
|
STableDataCxt* pDst = NULL;
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ static int32_t stmtParseSql(STscStmt2* pStmt) {
|
||||||
STableDataCxt** pSrc =
|
STableDataCxt** pSrc =
|
||||||
(STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
(STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
||||||
if (NULL == pSrc || NULL == *pSrc) {
|
if (NULL == pSrc || NULL == *pSrc) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
STableDataCxt* pTableCtx = *pSrc;
|
STableDataCxt* pTableCtx = *pSrc;
|
||||||
|
@ -295,7 +295,7 @@ static int32_t stmtParseSql(STscStmt2* pStmt) {
|
||||||
if (NULL == pStmt->sql.pBindInfo) {
|
if (NULL == pStmt->sql.pBindInfo) {
|
||||||
pStmt->sql.pBindInfo = taosMemoryMalloc(pTableCtx->boundColsInfo.numOfBound * sizeof(*pStmt->sql.pBindInfo));
|
pStmt->sql.pBindInfo = taosMemoryMalloc(pTableCtx->boundColsInfo.numOfBound * sizeof(*pStmt->sql.pBindInfo));
|
||||||
if (NULL == pStmt->sql.pBindInfo) {
|
if (NULL == pStmt->sql.pBindInfo) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -540,7 +540,7 @@ static int32_t stmtGetFromCache(STscStmt2* pStmt) {
|
||||||
|
|
||||||
if (taosHashPut(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName), &pNewBlock,
|
if (taosHashPut(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName), &pNewBlock,
|
||||||
POINTER_BYTES)) {
|
POINTER_BYTES)) {
|
||||||
STMT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
STMT_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
pStmt->exec.pCurrBlock = pNewBlock;
|
pStmt->exec.pCurrBlock = pNewBlock;
|
||||||
|
@ -630,7 +630,7 @@ static int32_t stmtGetFromCache(STscStmt2* pStmt) {
|
||||||
|
|
||||||
if (taosHashPut(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName), &pNewBlock,
|
if (taosHashPut(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName), &pNewBlock,
|
||||||
POINTER_BYTES)) {
|
POINTER_BYTES)) {
|
||||||
STMT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
STMT_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
pStmt->exec.pCurrBlock = pNewBlock;
|
pStmt->exec.pCurrBlock = pNewBlock;
|
||||||
|
@ -766,13 +766,11 @@ TAOS_STMT2* stmtInit2(STscObj* taos, TAOS_STMT2_OPTION* pOptions) {
|
||||||
|
|
||||||
pStmt = taosMemoryCalloc(1, sizeof(STscStmt2));
|
pStmt = taosMemoryCalloc(1, sizeof(STscStmt2));
|
||||||
if (NULL == pStmt) {
|
if (NULL == pStmt) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pStmt->sql.pTableCache = taosHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
|
pStmt->sql.pTableCache = taosHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
|
||||||
if (NULL == pStmt->sql.pTableCache) {
|
if (NULL == pStmt->sql.pTableCache) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
taosMemoryFree(pStmt);
|
taosMemoryFree(pStmt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -798,7 +796,6 @@ TAOS_STMT2* stmtInit2(STscObj* taos, TAOS_STMT2_OPTION* pOptions) {
|
||||||
pStmt->sql.siInfo.mgmtEpSet = getEpSet_s(&pStmt->taos->pAppInfo->mgmtEp);
|
pStmt->sql.siInfo.mgmtEpSet = getEpSet_s(&pStmt->taos->pAppInfo->mgmtEp);
|
||||||
pStmt->sql.siInfo.pTableHash = tSimpleHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY));
|
pStmt->sql.siInfo.pTableHash = tSimpleHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY));
|
||||||
if (NULL == pStmt->sql.siInfo.pTableHash) {
|
if (NULL == pStmt->sql.siInfo.pTableHash) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
(void)stmtClose(pStmt);
|
(void)stmtClose(pStmt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -894,7 +891,7 @@ int stmtPrepare2(TAOS_STMT2* stmt, const char* sql, unsigned long length) {
|
||||||
static int32_t stmtInitStbInterlaceTableInfo(STscStmt2* pStmt) {
|
static int32_t stmtInitStbInterlaceTableInfo(STscStmt2* pStmt) {
|
||||||
STableDataCxt** pSrc = taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
STableDataCxt** pSrc = taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
||||||
if (!pSrc) {
|
if (!pSrc) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
STableDataCxt* pDst = NULL;
|
STableDataCxt* pDst = NULL;
|
||||||
|
|
||||||
|
@ -1199,7 +1196,7 @@ static int32_t stmtCacheBlock(STscStmt2* pStmt) {
|
||||||
|
|
||||||
STableDataCxt** pSrc = taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
STableDataCxt** pSrc = taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
||||||
if (!pSrc) {
|
if (!pSrc) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
STableDataCxt* pDst = NULL;
|
STableDataCxt* pDst = NULL;
|
||||||
|
|
||||||
|
@ -1266,7 +1263,7 @@ static int32_t stmtBackupQueryFields(STscStmt2* pStmt) {
|
||||||
pRes->fields = taosMemoryMalloc(size);
|
pRes->fields = taosMemoryMalloc(size);
|
||||||
pRes->userFields = taosMemoryMalloc(size);
|
pRes->userFields = taosMemoryMalloc(size);
|
||||||
if (NULL == pRes->fields || NULL == pRes->userFields) {
|
if (NULL == pRes->fields || NULL == pRes->userFields) {
|
||||||
STMT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
STMT_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
(void)memcpy(pRes->fields, pStmt->exec.pRequest->body.resInfo.fields, size);
|
(void)memcpy(pRes->fields, pStmt->exec.pRequest->body.resInfo.fields, size);
|
||||||
(void)memcpy(pRes->userFields, pStmt->exec.pRequest->body.resInfo.userFields, size);
|
(void)memcpy(pRes->userFields, pStmt->exec.pRequest->body.resInfo.userFields, size);
|
||||||
|
@ -1284,7 +1281,7 @@ static int32_t stmtRestoreQueryFields(STscStmt2* pStmt) {
|
||||||
if (NULL == pStmt->exec.pRequest->body.resInfo.fields) {
|
if (NULL == pStmt->exec.pRequest->body.resInfo.fields) {
|
||||||
pStmt->exec.pRequest->body.resInfo.fields = taosMemoryMalloc(size);
|
pStmt->exec.pRequest->body.resInfo.fields = taosMemoryMalloc(size);
|
||||||
if (NULL == pStmt->exec.pRequest->body.resInfo.fields) {
|
if (NULL == pStmt->exec.pRequest->body.resInfo.fields) {
|
||||||
STMT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
STMT_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
(void)memcpy(pStmt->exec.pRequest->body.resInfo.fields, pRes->fields, size);
|
(void)memcpy(pStmt->exec.pRequest->body.resInfo.fields, pRes->fields, size);
|
||||||
}
|
}
|
||||||
|
@ -1292,7 +1289,7 @@ static int32_t stmtRestoreQueryFields(STscStmt2* pStmt) {
|
||||||
if (NULL == pStmt->exec.pRequest->body.resInfo.userFields) {
|
if (NULL == pStmt->exec.pRequest->body.resInfo.userFields) {
|
||||||
pStmt->exec.pRequest->body.resInfo.userFields = taosMemoryMalloc(size);
|
pStmt->exec.pRequest->body.resInfo.userFields = taosMemoryMalloc(size);
|
||||||
if (NULL == pStmt->exec.pRequest->body.resInfo.userFields) {
|
if (NULL == pStmt->exec.pRequest->body.resInfo.userFields) {
|
||||||
STMT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
STMT_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
(void)memcpy(pStmt->exec.pRequest->body.resInfo.userFields, pRes->userFields, size);
|
(void)memcpy(pStmt->exec.pRequest->body.resInfo.userFields, pRes->userFields, size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
tDecoderInit(&decoder, POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), pMsg->len - sizeof(SMqRspHead)); \
|
tDecoderInit(&decoder, POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), pMsg->len - sizeof(SMqRspHead)); \
|
||||||
if (FUNC(&decoder, DATA) < 0) { \
|
if (FUNC(&decoder, DATA) < 0) { \
|
||||||
tDecoderClear(&decoder); \
|
tDecoderClear(&decoder); \
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY; \
|
code = terrno; \
|
||||||
goto END;\
|
goto END;\
|
||||||
}\
|
}\
|
||||||
tDecoderClear(&decoder);\
|
tDecoderClear(&decoder);\
|
||||||
|
@ -1552,7 +1552,7 @@ static void tmqMgmtInit(void) {
|
||||||
tmqMgmt.timer = taosTmrInit(1000, 100, 360000, "TMQ");
|
tmqMgmt.timer = taosTmrInit(1000, 100, 360000, "TMQ");
|
||||||
|
|
||||||
if (tmqMgmt.timer == NULL) {
|
if (tmqMgmt.timer == NULL) {
|
||||||
tmqInitRes = TSDB_CODE_OUT_OF_MEMORY;
|
tmqInitRes = terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmqMgmt.rsetId = taosOpenRef(10000, tmqFreeImpl);
|
tmqMgmt.rsetId = taosOpenRef(10000, tmqFreeImpl);
|
||||||
|
@ -2520,7 +2520,7 @@ int32_t tmq_unsubscribe(tmq_t* tmq) {
|
||||||
|
|
||||||
tmq_list_t* lst = tmq_list_new();
|
tmq_list_t* lst = tmq_list_new();
|
||||||
if (lst == NULL) {
|
if (lst == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
code = tmq_subscribe(tmq, lst);
|
code = tmq_subscribe(tmq, lst);
|
||||||
|
@ -2701,10 +2701,12 @@ int32_t tmq_commit_sync(tmq_t* tmq, const TAOS_RES* pRes) {
|
||||||
tqErrorC("failed to allocate memory for sync commit");
|
tqErrorC("failed to allocate memory for sync commit");
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
if (tsem2_init(&pInfo->sem, 0, 0) != 0) {
|
|
||||||
|
code = tsem2_init(&pInfo->sem, 0, 0);
|
||||||
|
if (code != 0) {
|
||||||
tqErrorC("failed to init sem for sync commit");
|
tqErrorC("failed to init sem for sync commit");
|
||||||
taosMemoryFree(pInfo);
|
taosMemoryFree(pInfo);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return code;
|
||||||
}
|
}
|
||||||
pInfo->code = 0;
|
pInfo->code = 0;
|
||||||
|
|
||||||
|
@ -2778,9 +2780,10 @@ int32_t tmq_commit_offset_sync(tmq_t* tmq, const char* pTopicName, int32_t vgId,
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsem2_init(&pInfo->sem, 0, 0) != 0) {
|
code = tsem2_init(&pInfo->sem, 0, 0);
|
||||||
|
if (code != 0) {
|
||||||
taosMemoryFree(pInfo);
|
taosMemoryFree(pInfo);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return code;
|
||||||
}
|
}
|
||||||
pInfo->code = 0;
|
pInfo->code = 0;
|
||||||
|
|
||||||
|
@ -2967,9 +2970,10 @@ static int32_t tmCommittedCb(void* param, SDataBuf* pMsg, int32_t code) {
|
||||||
if (pMsg) {
|
if (pMsg) {
|
||||||
SDecoder decoder = {0};
|
SDecoder decoder = {0};
|
||||||
tDecoderInit(&decoder, (uint8_t*)pMsg->pData, pMsg->len);
|
tDecoderInit(&decoder, (uint8_t*)pMsg->pData, pMsg->len);
|
||||||
if (tDecodeMqVgOffset(&decoder, &pParam->vgOffset) < 0) {
|
int32_t err = tDecodeMqVgOffset(&decoder, &pParam->vgOffset);
|
||||||
|
if (err < 0) {
|
||||||
tOffsetDestroy(&pParam->vgOffset.offset);
|
tOffsetDestroy(&pParam->vgOffset.offset);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = err;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
|
@ -3262,8 +3266,9 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
|
||||||
code = terrno;
|
code = terrno;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (tsem2_init(&pCommon->rsp, 0, 0) != 0) {
|
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = tsem2_init(&pCommon->rsp, 0, 0);
|
||||||
|
if (code != 0) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
(void)taosThreadMutexInit(&pCommon->mutex, 0);
|
(void)taosThreadMutexInit(&pCommon->mutex, 0);
|
||||||
|
@ -3297,7 +3302,7 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
|
||||||
int32_t msgSize = tSerializeSMqPollReq(NULL, 0, &req);
|
int32_t msgSize = tSerializeSMqPollReq(NULL, 0, &req);
|
||||||
if (msgSize < 0) {
|
if (msgSize < 0) {
|
||||||
taosMemoryFree(pParam);
|
taosMemoryFree(pParam);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = msgSize;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3308,10 +3313,11 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tSerializeSMqPollReq(msg, msgSize, &req) < 0) {
|
msgSize = tSerializeSMqPollReq(msg, msgSize, &req);
|
||||||
|
if (msgSize < 0) {
|
||||||
taosMemoryFree(msg);
|
taosMemoryFree(msg);
|
||||||
taosMemoryFree(pParam);
|
taosMemoryFree(pParam);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = msgSize;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,8 @@ static int32_t vnodeGetBufPoolToUse(SVnode *pVnode) {
|
||||||
if (code && code != TSDB_CODE_TIMEOUT_ERROR) {
|
if (code && code != TSDB_CODE_TIMEOUT_ERROR) {
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -519,7 +519,7 @@ int32_t ctgGetTbDistVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, SName* pTabl
|
||||||
vgList = taosArrayInit(1, sizeof(SVgroupInfo));
|
vgList = taosArrayInit(1, sizeof(SVgroupInfo));
|
||||||
if (NULL == vgList) {
|
if (NULL == vgList) {
|
||||||
ctgError("taosArrayInit %d failed", (int32_t)sizeof(SVgroupInfo));
|
ctgError("taosArrayInit %d failed", (int32_t)sizeof(SVgroupInfo));
|
||||||
CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_JRET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == taosArrayPush(vgList, &vgroupInfo)) {
|
if (NULL == taosArrayPush(vgList, &vgroupInfo)) {
|
||||||
|
@ -877,13 +877,13 @@ int32_t catalogInit(SCatalogCfg* cfg) {
|
||||||
gCtgMgmt.timer = taosTmrInit(0, 0, 0, "catalog");
|
gCtgMgmt.timer = taosTmrInit(0, 0, 0, "catalog");
|
||||||
if (NULL == gCtgMgmt.timer) {
|
if (NULL == gCtgMgmt.timer) {
|
||||||
qError("init timer failed, error:%s", tstrerror(terrno));
|
qError("init timer failed, error:%s", tstrerror(terrno));
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
gCtgMgmt.cacheTimer = taosTmrStart(ctgProcessTimerEvent, CTG_DEFAULT_CACHE_MON_MSEC, NULL, gCtgMgmt.timer);
|
gCtgMgmt.cacheTimer = taosTmrStart(ctgProcessTimerEvent, CTG_DEFAULT_CACHE_MON_MSEC, NULL, gCtgMgmt.timer);
|
||||||
if (NULL == gCtgMgmt.cacheTimer) {
|
if (NULL == gCtgMgmt.cacheTimer) {
|
||||||
qError("start cache timer failed");
|
qError("start cache timer failed");
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
CTG_ERR_RET(ctgStartUpdateThread());
|
CTG_ERR_RET(ctgStartUpdateThread());
|
||||||
|
|
|
@ -1173,12 +1173,16 @@ int32_t ctgDumpTbIndexRes(SCtgTask* pTask) {
|
||||||
SCtgJob* pJob = pTask->pJob;
|
SCtgJob* pJob = pTask->pJob;
|
||||||
if (NULL == pJob->jobRes.pTableIndex) {
|
if (NULL == pJob->jobRes.pTableIndex) {
|
||||||
SArray* pRes = taosArrayInit(pJob->tbIndexNum, sizeof(SMetaRes));
|
SArray* pRes = taosArrayInit(pJob->tbIndexNum, sizeof(SMetaRes));
|
||||||
|
if (NULL == pRes) {
|
||||||
|
CTG_ERR_RET(terrno);
|
||||||
|
}
|
||||||
|
|
||||||
if (atomic_val_compare_exchange_ptr(&pJob->jobRes.pTableIndex, NULL, pRes)) {
|
if (atomic_val_compare_exchange_ptr(&pJob->jobRes.pTableIndex, NULL, pRes)) {
|
||||||
taosArrayDestroy(pRes);
|
taosArrayDestroy(pRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == pJob->jobRes.pTableIndex) {
|
if (NULL == pJob->jobRes.pTableIndex) {
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1198,12 +1202,16 @@ int32_t ctgDumpTbCfgRes(SCtgTask* pTask) {
|
||||||
SCtgJob* pJob = pTask->pJob;
|
SCtgJob* pJob = pTask->pJob;
|
||||||
if (NULL == pJob->jobRes.pTableCfg) {
|
if (NULL == pJob->jobRes.pTableCfg) {
|
||||||
SArray* pRes = taosArrayInit(pJob->tbCfgNum, sizeof(SMetaRes));
|
SArray* pRes = taosArrayInit(pJob->tbCfgNum, sizeof(SMetaRes));
|
||||||
|
if (NULL == pRes) {
|
||||||
|
CTG_ERR_RET(terrno);
|
||||||
|
}
|
||||||
|
|
||||||
if (atomic_val_compare_exchange_ptr(&pJob->jobRes.pTableCfg, NULL, pRes)) {
|
if (atomic_val_compare_exchange_ptr(&pJob->jobRes.pTableCfg, NULL, pRes)) {
|
||||||
taosArrayDestroy(pRes);
|
taosArrayDestroy(pRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == pJob->jobRes.pTableCfg) {
|
if (NULL == pJob->jobRes.pTableCfg) {
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1223,12 +1231,16 @@ int32_t ctgDumpTbTagRes(SCtgTask* pTask) {
|
||||||
SCtgJob* pJob = pTask->pJob;
|
SCtgJob* pJob = pTask->pJob;
|
||||||
if (NULL == pJob->jobRes.pTableTag) {
|
if (NULL == pJob->jobRes.pTableTag) {
|
||||||
SArray* pRes = taosArrayInit(pJob->tbTagNum, sizeof(SMetaRes));
|
SArray* pRes = taosArrayInit(pJob->tbTagNum, sizeof(SMetaRes));
|
||||||
|
if (NULL == pRes) {
|
||||||
|
CTG_ERR_RET(terrno);
|
||||||
|
}
|
||||||
|
|
||||||
if (atomic_val_compare_exchange_ptr(&pJob->jobRes.pTableTag, NULL, pRes)) {
|
if (atomic_val_compare_exchange_ptr(&pJob->jobRes.pTableTag, NULL, pRes)) {
|
||||||
taosArrayDestroy(pRes);
|
taosArrayDestroy(pRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == pJob->jobRes.pTableTag) {
|
if (NULL == pJob->jobRes.pTableTag) {
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3729,7 +3729,7 @@ int32_t ctgGetTbNamesFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbNa
|
||||||
for (int32_t i = 0; i < tbNum; ++i) {
|
for (int32_t i = 0; i < tbNum; ++i) {
|
||||||
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
CTG_ERR_JRET(ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag));
|
||||||
if (NULL == taosArrayPush(ctx->pResList, &(SMetaData){0})) {
|
if (NULL == taosArrayPush(ctx->pResList, &(SMetaData){0})) {
|
||||||
CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_JRET(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3863,7 +3863,7 @@ int32_t ctgGetViewsFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgViewsC
|
||||||
taosMemoryFree(pViewMeta->querySql);
|
taosMemoryFree(pViewMeta->querySql);
|
||||||
taosMemoryFree(pViewMeta->user);
|
taosMemoryFree(pViewMeta->user);
|
||||||
taosMemoryFree(pViewMeta);
|
taosMemoryFree(pViewMeta);
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
pViewMeta->pSchema = taosMemoryMalloc(pViewMeta->numOfCols * sizeof(SSchema));
|
pViewMeta->pSchema = taosMemoryMalloc(pViewMeta->numOfCols * sizeof(SSchema));
|
||||||
if (pViewMeta->pSchema == NULL) {
|
if (pViewMeta->pSchema == NULL) {
|
||||||
|
|
|
@ -34,9 +34,10 @@ int32_t ctgHandleBatchRsp(SCtgJob* pJob, SCtgTaskCallbackParam* cbParam, SDataBu
|
||||||
SBatchRspMsg* pRsp = NULL;
|
SBatchRspMsg* pRsp = NULL;
|
||||||
|
|
||||||
if (TSDB_CODE_SUCCESS == rspCode && pMsg->pData && (pMsg->len > 0)) {
|
if (TSDB_CODE_SUCCESS == rspCode && pMsg->pData && (pMsg->len > 0)) {
|
||||||
if (tDeserializeSBatchRsp(pMsg->pData, pMsg->len, &batchRsp) < 0) {
|
code = tDeserializeSBatchRsp(pMsg->pData, pMsg->len, &batchRsp);
|
||||||
|
if (code < 0) {
|
||||||
ctgError("tDeserializeSBatchRsp failed, msgLen:%d", pMsg->len);
|
ctgError("tDeserializeSBatchRsp failed, msgLen:%d", pMsg->len);
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
msgNum = taosArrayGetSize(batchRsp.pRsps);
|
msgNum = taosArrayGetSize(batchRsp.pRsps);
|
||||||
|
@ -673,7 +674,7 @@ int32_t ctgAddBatch(SCatalog* pCtg, int32_t vgId, SRequestConnInfo* pConn, SCtgT
|
||||||
newBatch.batchId = atomic_add_fetch_32(&pJob->batchId, 1);
|
newBatch.batchId = atomic_add_fetch_32(&pJob->batchId, 1);
|
||||||
|
|
||||||
if (0 != taosHashPut(pBatchs, &vgId, sizeof(vgId), &newBatch, sizeof(newBatch))) {
|
if (0 != taosHashPut(pBatchs, &vgId, sizeof(vgId), &newBatch, sizeof(newBatch))) {
|
||||||
CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_JRET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctgDebug("task %d %s req added to batch %d, target vgId %d", pTask->taskId, TMSG_INFO(msgType), newBatch.batchId,
|
ctgDebug("task %d %s req added to batch %d, target vgId %d", pTask->taskId, TMSG_INFO(msgType), newBatch.batchId,
|
||||||
|
@ -778,7 +779,7 @@ int32_t ctgBuildBatchReqMsg(SCtgBatch* pBatch, int32_t vgId, void** msg, int32_t
|
||||||
int32_t msgSize = tSerializeSBatchReq(NULL, 0, &batchReq);
|
int32_t msgSize = tSerializeSBatchReq(NULL, 0, &batchReq);
|
||||||
if (msgSize < 0) {
|
if (msgSize < 0) {
|
||||||
qError("tSerializeSBatchReq failed");
|
qError("tSerializeSBatchReq failed");
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(msgSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
*msg = taosMemoryCalloc(1, msgSize);
|
*msg = taosMemoryCalloc(1, msgSize);
|
||||||
|
@ -786,9 +787,10 @@ int32_t ctgBuildBatchReqMsg(SCtgBatch* pBatch, int32_t vgId, void** msg, int32_t
|
||||||
qError("calloc batchReq msg failed, size:%d", msgSize);
|
qError("calloc batchReq msg failed, size:%d", msgSize);
|
||||||
CTG_ERR_RET(terrno);
|
CTG_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
if (tSerializeSBatchReq(*msg, msgSize, &batchReq) < 0) {
|
msgSize = tSerializeSBatchReq(*msg, msgSize, &batchReq);
|
||||||
|
if (msgSize < 0) {
|
||||||
qError("tSerializeSBatchReq failed");
|
qError("tSerializeSBatchReq failed");
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(msgSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
*pSize = msgSize;
|
*pSize = msgSize;
|
||||||
|
|
|
@ -1620,7 +1620,7 @@ int32_t ctgCloneVgInfo(SDBVgInfo* src, SDBVgInfo** dst) {
|
||||||
taosHashCancelIterate(src->vgHash, pIter);
|
taosHashCancelIterate(src->vgHash, pIter);
|
||||||
taosHashCleanup((*dst)->vgHash);
|
taosHashCleanup((*dst)->vgHash);
|
||||||
taosMemoryFreeClear(*dst);
|
taosMemoryFreeClear(*dst);
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
pIter = taosHashIterate(src->vgHash, pIter);
|
pIter = taosHashIterate(src->vgHash, pIter);
|
||||||
|
@ -1787,7 +1787,7 @@ static int32_t ctgCloneDbVgroup(void* pSrc, void** ppDst) {
|
||||||
}
|
}
|
||||||
|
|
||||||
*ppDst = taosArrayDup((const SArray*)pSrc, NULL);
|
*ppDst = taosArrayDup((const SArray*)pSrc, NULL);
|
||||||
return (*ppDst) ? TSDB_CODE_SUCCESS : TSDB_CODE_OUT_OF_MEMORY;
|
return (*ppDst) ? TSDB_CODE_SUCCESS : terrno;
|
||||||
#else
|
#else
|
||||||
return TSDB_CODE_CTG_INTERNAL_ERROR;
|
return TSDB_CODE_CTG_INTERNAL_ERROR;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1824,7 +1824,7 @@ static int32_t ctgCloneDbInfo(void* pSrc, void** ppDst) {
|
||||||
#if 0
|
#if 0
|
||||||
SDbInfo* pDst = taosMemoryMalloc(sizeof(SDbInfo));
|
SDbInfo* pDst = taosMemoryMalloc(sizeof(SDbInfo));
|
||||||
if (NULL == pDst) {
|
if (NULL == pDst) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_MEMCPY(pDst, pSrc, sizeof(SDbInfo));
|
TAOS_MEMCPY(pDst, pSrc, sizeof(SDbInfo));
|
||||||
|
@ -2263,13 +2263,13 @@ static int32_t ctgCloneMetaDataArray(SArray* pSrc, __array_item_dup_fn_t copyFun
|
||||||
int32_t size = taosArrayGetSize(pSrc);
|
int32_t size = taosArrayGetSize(pSrc);
|
||||||
*pDst = taosArrayInit(size, sizeof(SMetaRes));
|
*pDst = taosArrayInit(size, sizeof(SMetaRes));
|
||||||
if (NULL == *pDst) {
|
if (NULL == *pDst) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
for (int32_t i = 0; i < size; ++i) {
|
for (int32_t i = 0; i < size; ++i) {
|
||||||
SMetaRes* pRes = taosArrayGet(pSrc, i);
|
SMetaRes* pRes = taosArrayGet(pSrc, i);
|
||||||
SMetaRes res = {.code = pRes->code, .pRes = copyFunc(pRes->pRes)};
|
SMetaRes res = {.code = pRes->code, .pRes = copyFunc(pRes->pRes)};
|
||||||
if (NULL == res.pRes) {
|
if (NULL == res.pRes) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
taosArrayPush(*pDst, &res);
|
taosArrayPush(*pDst, &res);
|
||||||
}
|
}
|
||||||
|
@ -2630,11 +2630,11 @@ int32_t ctgBuildViewNullRes(SCtgTask* pTask, SCtgViewsCtx* pCtx) {
|
||||||
int32_t dupViewMetaFromRsp(SViewMetaRsp* pRsp, SViewMeta* pViewMeta) {
|
int32_t dupViewMetaFromRsp(SViewMetaRsp* pRsp, SViewMeta* pViewMeta) {
|
||||||
pViewMeta->querySql = tstrdup(pRsp->querySql);
|
pViewMeta->querySql = tstrdup(pRsp->querySql);
|
||||||
if (NULL == pViewMeta->querySql) {
|
if (NULL == pViewMeta->querySql) {
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
pViewMeta->user = tstrdup(pRsp->user);
|
pViewMeta->user = tstrdup(pRsp->user);
|
||||||
if (NULL == pViewMeta->user) {
|
if (NULL == pViewMeta->user) {
|
||||||
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
CTG_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
pViewMeta->version = pRsp->version;
|
pViewMeta->version = pRsp->version;
|
||||||
pViewMeta->viewId = pRsp->viewId;
|
pViewMeta->viewId = pRsp->viewId;
|
||||||
|
|
|
@ -2056,7 +2056,7 @@ static int32_t qExplainPrepareCtx(SQueryPlan *pDag, SExplainCtx **pCtx) {
|
||||||
|
|
||||||
if (0 != taosHashPut(groupHash, &plan->id.groupId, sizeof(plan->id.groupId), &group, sizeof(group))) {
|
if (0 != taosHashPut(groupHash, &plan->id.groupId, sizeof(plan->id.groupId), &group, sizeof(group))) {
|
||||||
qError("taosHashPut to explainGroupHash failed, taskIdx:%d", n);
|
qError("taosHashPut to explainGroupHash failed, taskIdx:%d", n);
|
||||||
QRY_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
QRY_ERR_JRET(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,11 +131,18 @@ int32_t createAnomalywindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* p
|
||||||
|
|
||||||
int32_t itemSize = sizeof(int32_t) + pInfo->aggSup.resultRowSize + pInfo->anomalyKey.bytes;
|
int32_t itemSize = sizeof(int32_t) + pInfo->aggSup.resultRowSize + pInfo->anomalyKey.bytes;
|
||||||
pInfo->anomalySup.pResultRow = taosMemoryCalloc(1, itemSize);
|
pInfo->anomalySup.pResultRow = taosMemoryCalloc(1, itemSize);
|
||||||
|
if (pInfo->anomalySup.pResultRow == NULL) {
|
||||||
|
code = terrno;
|
||||||
|
goto _error;
|
||||||
|
}
|
||||||
pInfo->anomalySup.blocks = taosArrayInit(16, sizeof(SSDataBlock*));
|
pInfo->anomalySup.blocks = taosArrayInit(16, sizeof(SSDataBlock*));
|
||||||
|
if (pInfo->anomalySup.blocks == NULL) {
|
||||||
|
code = terrno;
|
||||||
|
goto _error;
|
||||||
|
}
|
||||||
pInfo->anomalySup.windows = taosArrayInit(16, sizeof(STimeWindow));
|
pInfo->anomalySup.windows = taosArrayInit(16, sizeof(STimeWindow));
|
||||||
|
if (pInfo->anomalySup.windows == NULL) {
|
||||||
if (pInfo->anomalySup.windows == NULL || pInfo->anomalySup.blocks == NULL || pInfo->anomalySup.pResultRow == NULL) {
|
code = terrno;
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,8 +276,8 @@ static int32_t anomalyCacheBlock(SAnomalyWindowOperatorInfo* pInfo, SSDataBlock*
|
||||||
int32_t code = createOneDataBlock(pSrc, true, &pDst);
|
int32_t code = createOneDataBlock(pSrc, true, &pDst);
|
||||||
|
|
||||||
if (code != 0) return code;
|
if (code != 0) return code;
|
||||||
if (pDst == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (pDst == NULL) return code;
|
||||||
if (taosArrayPush(pInfo->anomalySup.blocks, &pDst) == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
if (taosArrayPush(pInfo->anomalySup.blocks, &pDst) == NULL) return terrno;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ static int32_t allocBuf(SDataDeleterHandle* pDeleter, const SInputData* pInput,
|
||||||
if (taosQueueItemSize(pDeleter->pDataBlocks) > capacity) {
|
if (taosQueueItemSize(pDeleter->pDataBlocks) > capacity) {
|
||||||
qError("SinkNode queue is full, no capacity, max:%d, current:%d, no capacity", capacity,
|
qError("SinkNode queue is full, no capacity, max:%d, current:%d, no capacity", capacity,
|
||||||
taosQueueItemSize(pDeleter->pDataBlocks));
|
taosQueueItemSize(pDeleter->pDataBlocks));
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
pBuf->allocSize = sizeof(SDataCacheEntry) + sizeof(SDeleterRes);
|
pBuf->allocSize = sizeof(SDataCacheEntry) + sizeof(SDeleterRes);
|
||||||
|
|
|
@ -354,15 +354,15 @@ static int32_t initExchangeOperator(SExchangePhysiNode* pExNode, SExchangeInfo*
|
||||||
|
|
||||||
pInfo->pSources = taosArrayInit(numOfSources, sizeof(SDownstreamSourceNode));
|
pInfo->pSources = taosArrayInit(numOfSources, sizeof(SDownstreamSourceNode));
|
||||||
if (pInfo->pSources == NULL) {
|
if (pInfo->pSources == NULL) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pExNode->node.dynamicOp) {
|
if (pExNode->node.dynamicOp) {
|
||||||
pInfo->pHashSources = tSimpleHashInit(numOfSources * 2, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT));
|
pInfo->pHashSources = tSimpleHashInit(numOfSources * 2, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT));
|
||||||
if (NULL == pInfo->pHashSources) {
|
if (NULL == pInfo->pHashSources) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ static int32_t initExchangeOperator(SExchangePhysiNode* pExNode, SExchangeInfo*
|
||||||
SDownstreamSourceNode* pNode = (SDownstreamSourceNode*)nodesListGetNode((SNodeList*)pExNode->pSrcEndPoints, i);
|
SDownstreamSourceNode* pNode = (SDownstreamSourceNode*)nodesListGetNode((SNodeList*)pExNode->pSrcEndPoints, i);
|
||||||
if (!pNode) {
|
if (!pNode) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
void* tmp = taosArrayPush(pInfo->pSources, pNode);
|
void* tmp = taosArrayPush(pInfo->pSources, pNode);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
|
@ -668,7 +668,7 @@ int32_t doSendFetchDataRequest(SExchangeInfo* pExchangeInfo, SExecTaskInfo* pTas
|
||||||
|
|
||||||
int32_t msgSize = tSerializeSResFetchReq(NULL, 0, &req);
|
int32_t msgSize = tSerializeSResFetchReq(NULL, 0, &req);
|
||||||
if (msgSize < 0) {
|
if (msgSize < 0) {
|
||||||
pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY;
|
pTaskInfo->code = msgSize;
|
||||||
taosMemoryFree(pWrapper);
|
taosMemoryFree(pWrapper);
|
||||||
freeOperatorParam(req.pOpParam, OP_GET_PARAM);
|
freeOperatorParam(req.pOpParam, OP_GET_PARAM);
|
||||||
return pTaskInfo->code;
|
return pTaskInfo->code;
|
||||||
|
@ -676,14 +676,15 @@ int32_t doSendFetchDataRequest(SExchangeInfo* pExchangeInfo, SExecTaskInfo* pTas
|
||||||
|
|
||||||
void* msg = taosMemoryCalloc(1, msgSize);
|
void* msg = taosMemoryCalloc(1, msgSize);
|
||||||
if (NULL == msg) {
|
if (NULL == msg) {
|
||||||
pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY;
|
pTaskInfo->code = terrno;
|
||||||
taosMemoryFree(pWrapper);
|
taosMemoryFree(pWrapper);
|
||||||
freeOperatorParam(req.pOpParam, OP_GET_PARAM);
|
freeOperatorParam(req.pOpParam, OP_GET_PARAM);
|
||||||
return pTaskInfo->code;
|
return pTaskInfo->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tSerializeSResFetchReq(msg, msgSize, &req) < 0) {
|
msgSize = tSerializeSResFetchReq(msg, msgSize, &req);
|
||||||
pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY;
|
if (msgSize < 0) {
|
||||||
|
pTaskInfo->code = msgSize;
|
||||||
taosMemoryFree(pWrapper);
|
taosMemoryFree(pWrapper);
|
||||||
taosMemoryFree(msg);
|
taosMemoryFree(msg);
|
||||||
freeOperatorParam(req.pOpParam, OP_GET_PARAM);
|
freeOperatorParam(req.pOpParam, OP_GET_PARAM);
|
||||||
|
@ -703,7 +704,7 @@ int32_t doSendFetchDataRequest(SExchangeInfo* pExchangeInfo, SExecTaskInfo* pTas
|
||||||
taosMemoryFreeClear(msg);
|
taosMemoryFreeClear(msg);
|
||||||
taosMemoryFree(pWrapper);
|
taosMemoryFree(pWrapper);
|
||||||
qError("%s prepare message %d failed", GET_TASKID(pTaskInfo), (int32_t)sizeof(SMsgSendInfo));
|
qError("%s prepare message %d failed", GET_TASKID(pTaskInfo), (int32_t)sizeof(SMsgSendInfo));
|
||||||
pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY;
|
pTaskInfo->code = terrno;
|
||||||
return pTaskInfo->code;
|
return pTaskInfo->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -899,7 +900,7 @@ int32_t doExtractResultBlocks(SExchangeInfo* pExchangeInfo, SSourceDataInfo* pDa
|
||||||
blockDataCleanup(pb);
|
blockDataCleanup(pb);
|
||||||
} else {
|
} else {
|
||||||
code = createOneDataBlock(pExchangeInfo->pDummyBlock, false, &pb);
|
code = createOneDataBlock(pExchangeInfo->pDummyBlock, false, &pb);
|
||||||
QUERY_CHECK_NULL(pb, code, lino, _end, TSDB_CODE_OUT_OF_MEMORY);
|
QUERY_CHECK_NULL(pb, code, lino, _end, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t compLen = *(int32_t*)pStart;
|
int32_t compLen = *(int32_t*)pStart;
|
||||||
|
@ -1056,7 +1057,7 @@ int32_t addSingleExchangeSource(SOperatorInfo* pOperator, SExchangeOperatorBasic
|
||||||
|
|
||||||
void* tmp = taosArrayPush(pExchangeInfo->pSourceDataInfo, &dataInfo);
|
void* tmp = taosArrayPush(pExchangeInfo->pSourceDataInfo, &dataInfo);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
pIdx->inUseIdx = taosArrayGetSize(pExchangeInfo->pSourceDataInfo) - 1;
|
pIdx->inUseIdx = taosArrayGetSize(pExchangeInfo->pSourceDataInfo) - 1;
|
||||||
|
|
|
@ -332,7 +332,6 @@ SArray* createSortInfo(SNodeList* pNodeList) {
|
||||||
|
|
||||||
SArray* pList = taosArrayInit(numOfCols, sizeof(SBlockOrderInfo));
|
SArray* pList = taosArrayInit(numOfCols, sizeof(SBlockOrderInfo));
|
||||||
if (pList == NULL) {
|
if (pList == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return pList;
|
return pList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +341,7 @@ SArray* createSortInfo(SNodeList* pNodeList) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
taosArrayDestroy(pList);
|
taosArrayDestroy(pList);
|
||||||
pList = NULL;
|
pList = NULL;
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SBlockOrderInfo bi = {0};
|
SBlockOrderInfo bi = {0};
|
||||||
|
@ -355,7 +354,6 @@ SArray* createSortInfo(SNodeList* pNodeList) {
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
taosArrayDestroy(pList);
|
taosArrayDestroy(pList);
|
||||||
pList = NULL;
|
pList = NULL;
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1129,7 +1127,7 @@ static int32_t optimizeTbnameInCondImpl(void* pVnode, SArray* pExistedUidList, S
|
||||||
if (numOfExisted > 0) {
|
if (numOfExisted > 0) {
|
||||||
uHash = taosHashInit(numOfExisted / 0.7, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
|
uHash = taosHashInit(numOfExisted / 0.7, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
|
||||||
if (!uHash) {
|
if (!uHash) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1330,7 +1328,7 @@ static int32_t copyExistedUids(SArray* pUidTagList, const SArray* pUidList) {
|
||||||
STUidTagInfo info = {.uid = *uid};
|
STUidTagInfo info = {.uid = *uid};
|
||||||
void* tmp = taosArrayPush(pUidTagList, &info);
|
void* tmp = taosArrayPush(pUidTagList, &info);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1356,15 +1354,13 @@ static int32_t doFilterByTagCond(STableListInfo* pListInfo, SArray* pUidList, SN
|
||||||
tagFilterAssist ctx = {0};
|
tagFilterAssist ctx = {0};
|
||||||
ctx.colHash = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_SMALLINT), false, HASH_NO_LOCK);
|
ctx.colHash = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_SMALLINT), false, HASH_NO_LOCK);
|
||||||
if (ctx.colHash == NULL) {
|
if (ctx.colHash == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
QUERY_CHECK_CODE(code, lino, end);
|
QUERY_CHECK_CODE(code, lino, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.cInfoList = taosArrayInit(4, sizeof(SColumnInfo));
|
ctx.cInfoList = taosArrayInit(4, sizeof(SColumnInfo));
|
||||||
if (ctx.cInfoList == NULL) {
|
if (ctx.cInfoList == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
QUERY_CHECK_CODE(code, lino, end);
|
QUERY_CHECK_CODE(code, lino, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1717,7 +1713,6 @@ SArray* makeColumnArrayFromList(SNodeList* pNodeList) {
|
||||||
size_t numOfCols = LIST_LENGTH(pNodeList);
|
size_t numOfCols = LIST_LENGTH(pNodeList);
|
||||||
SArray* pList = taosArrayInit(numOfCols, sizeof(SColumn));
|
SArray* pList = taosArrayInit(numOfCols, sizeof(SColumn));
|
||||||
if (pList == NULL) {
|
if (pList == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1725,7 +1720,7 @@ SArray* makeColumnArrayFromList(SNodeList* pNodeList) {
|
||||||
SColumnNode* pColNode = (SColumnNode*)nodesListGetNode(pNodeList, i);
|
SColumnNode* pColNode = (SColumnNode*)nodesListGetNode(pNodeList, i);
|
||||||
if (!pColNode) {
|
if (!pColNode) {
|
||||||
taosArrayDestroy(pList);
|
taosArrayDestroy(pList);
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1741,7 +1736,7 @@ SArray* makeColumnArrayFromList(SNodeList* pNodeList) {
|
||||||
void* tmp = taosArrayPush(pList, &c);
|
void* tmp = taosArrayPush(pList, &c);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
taosArrayDestroy(pList);
|
taosArrayDestroy(pList);
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1836,7 +1831,6 @@ static SResSchema createResSchema(int32_t type, int32_t bytes, int32_t slotId, i
|
||||||
static SColumn* createColumn(int32_t blockId, int32_t slotId, int32_t colId, SDataType* pType, EColumnType colType) {
|
static SColumn* createColumn(int32_t blockId, int32_t slotId, int32_t colId, SDataType* pType, EColumnType colType) {
|
||||||
SColumn* pCol = taosMemoryCalloc(1, sizeof(SColumn));
|
SColumn* pCol = taosMemoryCalloc(1, sizeof(SColumn));
|
||||||
if (pCol == NULL) {
|
if (pCol == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2175,7 +2169,7 @@ SqlFunctionCtx* createSqlFunctionCtx(SExprInfo* pExprInfo, int32_t numOfOutput,
|
||||||
}
|
}
|
||||||
bool tmp = pCtx->fpSet.getEnv(pExpr->pExpr->_function.pFunctNode, &env);
|
bool tmp = pCtx->fpSet.getEnv(pExpr->pExpr->_function.pFunctNode, &env);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
QUERY_CHECK_CODE(code, lino, _end);
|
QUERY_CHECK_CODE(code, lino, _end);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2188,7 +2182,7 @@ SqlFunctionCtx* createSqlFunctionCtx(SExprInfo* pExprInfo, int32_t numOfOutput,
|
||||||
if (pCtx->sfp.getEnv != NULL) {
|
if (pCtx->sfp.getEnv != NULL) {
|
||||||
bool tmp = pCtx->sfp.getEnv(pExpr->pExpr->_function.pFunctNode, &env);
|
bool tmp = pCtx->sfp.getEnv(pExpr->pExpr->_function.pFunctNode, &env);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
QUERY_CHECK_CODE(code, lino, _end);
|
QUERY_CHECK_CODE(code, lino, _end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2237,6 +2231,8 @@ _end:
|
||||||
}
|
}
|
||||||
taosMemoryFreeClear(*rowEntryInfoOffset);
|
taosMemoryFreeClear(*rowEntryInfoOffset);
|
||||||
taosMemoryFreeClear(pFuncCtx);
|
taosMemoryFreeClear(pFuncCtx);
|
||||||
|
|
||||||
|
terrno = code;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return pFuncCtx;
|
return pFuncCtx;
|
||||||
|
@ -3074,6 +3070,7 @@ SNodeList* makeColsNodeArrFromSortKeys(SNodeList* pSortKeys) {
|
||||||
int32_t code = nodesListMakeAppend(&ret, pSortKey->pExpr);
|
int32_t code = nodesListMakeAppend(&ret, pSortKey->pExpr);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
|
||||||
|
terrno = code;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -742,7 +742,7 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, bo
|
||||||
QUERY_CHECK_CODE(code, lino, _end);
|
QUERY_CHECK_CODE(code, lino, _end);
|
||||||
|
|
||||||
void* tmp = taosArrayPush(pTaskInfo->pResultBlockList, &p1);
|
void* tmp = taosArrayPush(pTaskInfo->pResultBlockList, &p1);
|
||||||
QUERY_CHECK_NULL(tmp, code, lino, _end, TSDB_CODE_OUT_OF_MEMORY);
|
QUERY_CHECK_NULL(tmp, code, lino, _end, terrno);
|
||||||
p = p1;
|
p = p1;
|
||||||
} else {
|
} else {
|
||||||
void* tmp = taosArrayGet(pTaskInfo->pResultBlockList, blockIndex);
|
void* tmp = taosArrayGet(pTaskInfo->pResultBlockList, blockIndex);
|
||||||
|
@ -897,7 +897,7 @@ int32_t qAppendTaskStopInfo(SExecTaskInfo* pTaskInfo, SExchangeOpStopInfo* pInfo
|
||||||
taosWUnLockLatch(&pTaskInfo->stopInfo.lock);
|
taosWUnLockLatch(&pTaskInfo->stopInfo.lock);
|
||||||
|
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -1586,8 +1586,7 @@ void qProcessRspMsg(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
|
||||||
if (pMsg->contLen > 0) {
|
if (pMsg->contLen > 0) {
|
||||||
buf.pData = taosMemoryCalloc(1, pMsg->contLen);
|
buf.pData = taosMemoryCalloc(1, pMsg->contLen);
|
||||||
if (buf.pData == NULL) {
|
if (buf.pData == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
pMsg->code = terrno;
|
||||||
pMsg->code = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
} else {
|
} else {
|
||||||
memcpy(buf.pData, pMsg->pCont, pMsg->contLen);
|
memcpy(buf.pData, pMsg->pCont, pMsg->contLen);
|
||||||
}
|
}
|
||||||
|
@ -1606,7 +1605,6 @@ SArray* qGetQueriedTableListInfo(qTaskInfo_t tinfo) {
|
||||||
|
|
||||||
code = getTableListInfo(pTaskInfo, &plist);
|
code = getTableListInfo(pTaskInfo, &plist);
|
||||||
if (code || plist == NULL) {
|
if (code || plist == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -438,9 +438,6 @@ static int32_t doCreateConstantValColumnSMAInfo(SInputColumnInfoData* pInput, SF
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
pInput->pColumnDataAgg[paramIndex] = da;
|
pInput->pColumnDataAgg[paramIndex] = da;
|
||||||
if (da == NULL) {
|
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
da = pInput->pColumnDataAgg[paramIndex];
|
da = pInput->pColumnDataAgg[paramIndex];
|
||||||
}
|
}
|
||||||
|
@ -1056,7 +1053,7 @@ int32_t initExprSupp(SExprSupp* pSup, SExprInfo* pExprInfo, int32_t numOfExpr, S
|
||||||
if (pSup->pExprInfo != NULL) {
|
if (pSup->pExprInfo != NULL) {
|
||||||
pSup->pCtx = createSqlFunctionCtx(pExprInfo, numOfExpr, &pSup->rowEntryInfoOffset, pStore);
|
pSup->pCtx = createSqlFunctionCtx(pExprInfo, numOfExpr, &pSup->rowEntryInfoOffset, pStore);
|
||||||
if (pSup->pCtx == NULL) {
|
if (pSup->pCtx == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1145,7 +1142,7 @@ int32_t createDataSinkParam(SDataSinkNode* pNode, void** pParam, SExecTaskInfo*
|
||||||
if (!pTable) {
|
if (!pTable) {
|
||||||
taosArrayDestroy(pDeleterParam->pUidList);
|
taosArrayDestroy(pDeleterParam->pUidList);
|
||||||
taosMemoryFree(pDeleterParam);
|
taosMemoryFree(pDeleterParam);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
void* tmp = taosArrayPush(pDeleterParam->pUidList, &pTable->uid);
|
void* tmp = taosArrayPush(pDeleterParam->pUidList, &pTable->uid);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
|
|
|
@ -387,10 +387,10 @@ static int32_t initFillInfo(SFillOperatorInfo* pInfo, SExprInfo* pExpr, int32_t
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pInfo->pFillInfo == NULL || pInfo->p == NULL) {
|
if (pInfo->pFillInfo == NULL) {
|
||||||
taosMemoryFree(pInfo->pFillInfo);
|
taosMemoryFree(pInfo->pFillInfo);
|
||||||
taosMemoryFree(pInfo->p);
|
taosMemoryFree(pInfo->p);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR;
|
||||||
} else {
|
} else {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -384,7 +384,7 @@ void freeGcBlkBufInfo(void* ptr) {
|
||||||
static int32_t addBlkToDirtyBufList(SGroupCacheOperatorInfo* pGCache, SGcDownstreamCtx* pCtx, SGcBlkCacheInfo* pCache, SGcBlkBufInfo* pBufInfo) {
|
static int32_t addBlkToDirtyBufList(SGroupCacheOperatorInfo* pGCache, SGcDownstreamCtx* pCtx, SGcBlkCacheInfo* pCache, SGcBlkBufInfo* pBufInfo) {
|
||||||
if (0 != taosHashPut(pCache->pDirtyBlk, &pBufInfo->basic.blkId, sizeof(pBufInfo->basic.blkId), pBufInfo, sizeof(*pBufInfo))) {
|
if (0 != taosHashPut(pCache->pDirtyBlk, &pBufInfo->basic.blkId, sizeof(pBufInfo->basic.blkId), pBufInfo, sizeof(*pBufInfo))) {
|
||||||
freeGcBlkBufInfo(pBufInfo);
|
freeGcBlkBufInfo(pBufInfo);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
pBufInfo = taosHashGet(pCache->pDirtyBlk, &pBufInfo->basic.blkId, sizeof(pBufInfo->basic.blkId));
|
pBufInfo = taosHashGet(pCache->pDirtyBlk, &pBufInfo->basic.blkId, sizeof(pBufInfo->basic.blkId));
|
||||||
if (NULL == pBufInfo) {
|
if (NULL == pBufInfo) {
|
||||||
|
@ -906,7 +906,7 @@ static int32_t addNewGroupData(struct SOperatorInfo* pOperator, SOperatorParam*
|
||||||
|
|
||||||
*ppGrp = taosHashGet(pGrpHash, &uid, sizeof(uid));
|
*ppGrp = taosHashGet(pGrpHash, &uid, sizeof(uid));
|
||||||
if (NULL == *ppGrp) {
|
if (NULL == *ppGrp) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
QRY_ERR_RET(initNewGroupData(pCtx, *ppGrp, pParam->downstreamIdx, vgId, pGCache->batchFetch, pGcParam->needCache));
|
QRY_ERR_RET(initNewGroupData(pCtx, *ppGrp, pParam->downstreamIdx, vgId, pGCache->batchFetch, pGcParam->needCache));
|
||||||
|
|
||||||
|
@ -1147,12 +1147,12 @@ static int32_t groupCacheSessionWait(struct SOperatorInfo* pOperator, SGcDownstr
|
||||||
if (NULL == pGroup->waitQueue) {
|
if (NULL == pGroup->waitQueue) {
|
||||||
pGroup->waitQueue = taosArrayInit(1, POINTER_BYTES);
|
pGroup->waitQueue = taosArrayInit(1, POINTER_BYTES);
|
||||||
if (NULL == pGroup->waitQueue) {
|
if (NULL == pGroup->waitQueue) {
|
||||||
QRY_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
QRY_ERR_JRET(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == taosArrayPush(pGroup->waitQueue, &pSession)) {
|
if (NULL == taosArrayPush(pGroup->waitQueue, &pSession)) {
|
||||||
QRY_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
QRY_ERR_JRET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pSession->semInit) {
|
if (!pSession->semInit) {
|
||||||
|
@ -1413,7 +1413,7 @@ static int32_t initGroupCacheDownstreamCtx(SOperatorInfo* pOperator) {
|
||||||
pCtx->lastBlkUid = 0;
|
pCtx->lastBlkUid = 0;
|
||||||
pCtx->pVgTbHash = tSimpleHashInit(10, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT));
|
pCtx->pVgTbHash = tSimpleHashInit(10, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT));
|
||||||
if (NULL == pCtx->pVgTbHash) {
|
if (NULL == pCtx->pVgTbHash) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
tSimpleHashSetFreeFp(pCtx->pVgTbHash, freeSGcVgroupCtx);
|
tSimpleHashSetFreeFp(pCtx->pVgTbHash, freeSGcVgroupCtx);
|
||||||
|
|
||||||
|
|
|
@ -614,7 +614,6 @@ SSDataBlock* createBlockDataNotLoaded(const SOperatorInfo* pOperator, SSDataBloc
|
||||||
if (pDataBlock->pBlockAgg) {
|
if (pDataBlock->pBlockAgg) {
|
||||||
pDstBlock->pBlockAgg = taosMemoryCalloc(numOfCols, sizeof(SColumnDataAgg));
|
pDstBlock->pBlockAgg = taosMemoryCalloc(numOfCols, sizeof(SColumnDataAgg));
|
||||||
if (pDstBlock->pBlockAgg == NULL) {
|
if (pDstBlock->pBlockAgg == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
blockDataDestroy(pDstBlock);
|
blockDataDestroy(pDstBlock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -804,7 +804,7 @@ static int32_t hJoinAddRowToHashImpl(SHJoinOperatorInfo* pJoin, SGroupData* pGro
|
||||||
pRow->next = NULL;
|
pRow->next = NULL;
|
||||||
if (tSimpleHashPut(pJoin->pKeyHash, pTable->keyData, keyLen, &group, sizeof(group))) {
|
if (tSimpleHashPut(pJoin->pKeyHash, pTable->keyData, keyLen, &group, sizeof(group))) {
|
||||||
taosMemoryFree(pRow);
|
taosMemoryFree(pRow);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pRow->next = pGroup->rows;
|
pRow->next = pGroup->rows;
|
||||||
|
@ -1201,7 +1201,7 @@ int32_t createHashJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDow
|
||||||
size_t hashCap = pInfo->pBuild->inputStat.inputRowNum > 0 ? (pInfo->pBuild->inputStat.inputRowNum * 1.5) : 1024;
|
size_t hashCap = pInfo->pBuild->inputStat.inputRowNum > 0 ? (pInfo->pBuild->inputStat.inputRowNum * 1.5) : 1024;
|
||||||
pInfo->pKeyHash = tSimpleHashInit(hashCap, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY));
|
pInfo->pKeyHash = tSimpleHashInit(hashCap, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY));
|
||||||
if (pInfo->pKeyHash == NULL) {
|
if (pInfo->pKeyHash == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _return;
|
goto _return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -331,7 +331,7 @@ int32_t openNonSortMergeOperator(SOperatorInfo* pOperator) {
|
||||||
pNonSortMergeInfo->pSourceStatus =
|
pNonSortMergeInfo->pSourceStatus =
|
||||||
taosMemoryCalloc(pOperator->numOfDownstream, sizeof(*pNonSortMergeInfo->pSourceStatus));
|
taosMemoryCalloc(pOperator->numOfDownstream, sizeof(*pNonSortMergeInfo->pSourceStatus));
|
||||||
if (NULL == pNonSortMergeInfo->pSourceStatus) {
|
if (NULL == pNonSortMergeInfo->pSourceStatus) {
|
||||||
pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY;
|
pTaskInfo->code = terrno;
|
||||||
return pTaskInfo->code;
|
return pTaskInfo->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -722,7 +722,7 @@ int32_t getOperatorExplainExecInfo(SOperatorInfo* operatorInfo, SArray* pExecInf
|
||||||
code = getOperatorExplainExecInfo(operatorInfo->pDownstream[i], pExecInfoList);
|
code = getOperatorExplainExecInfo(operatorInfo->pDownstream[i], pExecInfoList);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
// taosMemoryFreeClear(*pRes);
|
// taosMemoryFreeClear(*pRes);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1167,7 +1167,7 @@ static int32_t createTableListInfoFromParam(SOperatorInfo* pOperator) {
|
||||||
if (TSDB_CODE_DUP_KEY == terrno) {
|
if (TSDB_CODE_DUP_KEY == terrno) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
info.uid = *pUid;
|
info.uid = *pUid;
|
||||||
|
@ -4572,11 +4572,10 @@ int32_t createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhysiNode*
|
||||||
int32_t numOfTags;
|
int32_t numOfTags;
|
||||||
SExprInfo* pTagExpr = createExpr(pTableScanNode->pTags, &numOfTags);
|
SExprInfo* pTagExpr = createExpr(pTableScanNode->pTags, &numOfTags);
|
||||||
if (pTagExpr == NULL) {
|
if (pTagExpr == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
if (initExprSupp(&pInfo->tagCalSup, pTagExpr, numOfTags, &pTaskInfo->storageAPI.functionStore) != 0) {
|
code = initExprSupp(&pInfo->tagCalSup, pTagExpr, numOfTags, &pTaskInfo->storageAPI.functionStore);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
if (code != 0) {
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5173,7 +5172,7 @@ static int32_t doTagScanFromMetaEntryNext(SOperatorInfo* pOperator, SSDataBlock*
|
||||||
|
|
||||||
while (pInfo->curPos < size && pRes->info.rows < pOperator->resultInfo.capacity) {
|
while (pInfo->curPos < size && pRes->info.rows < pOperator->resultInfo.capacity) {
|
||||||
code = doTagScanOneTable(pOperator, pRes, &mr, &pTaskInfo->storageAPI);
|
code = doTagScanOneTable(pOperator, pRes, &mr, &pTaskInfo->storageAPI);
|
||||||
if (code != TSDB_CODE_OUT_OF_MEMORY) {
|
if (code != TSDB_CODE_OUT_OF_MEMORY && code != TSDB_CODE_QRY_REACH_QMEM_THRESHOLD && code != TSDB_CODE_QRY_QUERY_MEM_EXHAUSTED) {
|
||||||
// ignore other error
|
// ignore other error
|
||||||
code = TSDB_CODE_SUCCESS;
|
code = TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,10 +112,10 @@ int32_t createSortOperatorInfo(SOperatorInfo* downstream, SSortPhysiNode* pSortN
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
SNodeList* pSortColsNodeArr = makeColsNodeArrFromSortKeys(pSortNode->pSortKeys);
|
SNodeList* pSortColsNodeArr = makeColsNodeArrFromSortKeys(pSortNode->pSortKeys);
|
||||||
if (!pSortColsNodeArr) code = TSDB_CODE_OUT_OF_MEMORY;
|
if (!pSortColsNodeArr) code = terrno;
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
pGroupIdCalc->pSortColsArr = makeColumnArrayFromList(pSortColsNodeArr);
|
pGroupIdCalc->pSortColsArr = makeColumnArrayFromList(pSortColsNodeArr);
|
||||||
if (!pGroupIdCalc->pSortColsArr) code = TSDB_CODE_OUT_OF_MEMORY;
|
if (!pGroupIdCalc->pSortColsArr) code = terrno;
|
||||||
nodesClearList(pSortColsNodeArr);
|
nodesClearList(pSortColsNodeArr);
|
||||||
}
|
}
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
|
|
@ -549,7 +549,7 @@ void doStreamEventSaveCheckpoint(SOperatorInfo* pOperator) {
|
||||||
int32_t len = doStreamEventEncodeOpState(NULL, 0, pOperator);
|
int32_t len = doStreamEventEncodeOpState(NULL, 0, pOperator);
|
||||||
void* buf = taosMemoryCalloc(1, len);
|
void* buf = taosMemoryCalloc(1, len);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void* pBuf = buf;
|
void* pBuf = buf;
|
||||||
|
|
|
@ -1466,7 +1466,7 @@ void doStreamIntervalSaveCheckpoint(SOperatorInfo* pOperator) {
|
||||||
int32_t len = doStreamIntervalEncodeOpState(NULL, 0, pOperator);
|
int32_t len = doStreamIntervalEncodeOpState(NULL, 0, pOperator);
|
||||||
void* buf = taosMemoryCalloc(1, len);
|
void* buf = taosMemoryCalloc(1, len);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void* pBuf = buf;
|
void* pBuf = buf;
|
||||||
|
|
|
@ -609,7 +609,6 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pInfo->pCur || !pInfo->pSchema) {
|
if (!pInfo->pCur || !pInfo->pSchema) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
qError("sysTableScanUserCols failed since %s", terrstr());
|
qError("sysTableScanUserCols failed since %s", terrstr());
|
||||||
blockDataDestroy(pDataBlock);
|
blockDataDestroy(pDataBlock);
|
||||||
pInfo->loadInfo.totalRows = 0;
|
pInfo->loadInfo.totalRows = 0;
|
||||||
|
@ -1014,7 +1013,7 @@ static int32_t sysTableGetGeomText(char* iGeom, int32_t nGeom, char** output, in
|
||||||
char* outputWKT = NULL;
|
char* outputWKT = NULL;
|
||||||
|
|
||||||
if (nGeom == 0) {
|
if (nGeom == 0) {
|
||||||
if (!(*output = taosStrdup(""))) code = TSDB_CODE_OUT_OF_MEMORY;
|
if (!(*output = taosStrdup(""))) code = terrno;
|
||||||
*nOutput = 0;
|
*nOutput = 0;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -1112,8 +1111,9 @@ static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo,
|
||||||
code = sysTableGetGeomText(tagVal.pData, tagVal.nData, &tagData, &tagLen);
|
code = sysTableGetGeomText(tagVal.pData, tagVal.nData, &tagData, &tagLen);
|
||||||
QUERY_CHECK_CODE(code, lino, _end);
|
QUERY_CHECK_CODE(code, lino, _end);
|
||||||
} else if (tagType == TSDB_DATA_TYPE_VARBINARY) {
|
} else if (tagType == TSDB_DATA_TYPE_VARBINARY) {
|
||||||
if (taosAscii2Hex(tagVal.pData, tagVal.nData, (void**)&tagData, &tagLen) < 0) {
|
code = taosAscii2Hex(tagVal.pData, tagVal.nData, (void**)&tagData, &tagLen);
|
||||||
qError("varbinary for systable failed since %s", tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
if (code < 0) {
|
||||||
|
qError("varbinary for systable failed since %s", tstrerror(code));
|
||||||
}
|
}
|
||||||
} else if (IS_VAR_DATA_TYPE(tagType)) {
|
} else if (IS_VAR_DATA_TYPE(tagType)) {
|
||||||
tagData = (char*)tagVal.pData;
|
tagData = (char*)tagVal.pData;
|
||||||
|
@ -2397,7 +2397,7 @@ static SSDataBlock* sysTableScanFromMNode(SOperatorInfo* pOperator, SSysTableSca
|
||||||
SMsgSendInfo* pMsgSendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
SMsgSendInfo* pMsgSendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
||||||
if (NULL == pMsgSendInfo) {
|
if (NULL == pMsgSendInfo) {
|
||||||
qError("%s prepare message %d failed", GET_TASKID(pTaskInfo), (int32_t)sizeof(SMsgSendInfo));
|
qError("%s prepare message %d failed", GET_TASKID(pTaskInfo), (int32_t)sizeof(SMsgSendInfo));
|
||||||
pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY;
|
pTaskInfo->code = terrno;
|
||||||
taosMemoryFree(buf1);
|
taosMemoryFree(buf1);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -630,7 +630,7 @@ static void doInterpUnclosedTimeWindow(SOperatorInfo* pOperatorInfo, int32_t num
|
||||||
int32_t ret = setTimeWindowOutputBuf(pResultRowInfo, &w, (scanFlag == MAIN_SCAN), &pResult, groupId, pSup->pCtx,
|
int32_t ret = setTimeWindowOutputBuf(pResultRowInfo, &w, (scanFlag == MAIN_SCAN), &pResult, groupId, pSup->pCtx,
|
||||||
numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo);
|
numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo);
|
||||||
if (ret != TSDB_CODE_SUCCESS) {
|
if (ret != TSDB_CODE_SUCCESS) {
|
||||||
T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY);
|
T_LONG_JMP(pTaskInfo->env, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isResultRowInterpolated(pResult, RESULT_ROW_END_INTERP)) {
|
if(isResultRowInterpolated(pResult, RESULT_ROW_END_INTERP)) {
|
||||||
|
@ -780,7 +780,7 @@ static bool hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul
|
||||||
int32_t ret = setTimeWindowOutputBuf(pResultRowInfo, &win, (scanFlag == MAIN_SCAN), &pResult, tableGroupId,
|
int32_t ret = setTimeWindowOutputBuf(pResultRowInfo, &win, (scanFlag == MAIN_SCAN), &pResult, tableGroupId,
|
||||||
pSup->pCtx, numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo);
|
pSup->pCtx, numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo);
|
||||||
if (ret != TSDB_CODE_SUCCESS || pResult == NULL) {
|
if (ret != TSDB_CODE_SUCCESS || pResult == NULL) {
|
||||||
T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY);
|
T_LONG_JMP(pTaskInfo->env, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
TSKEY ekey = ascScan ? win.ekey : win.skey;
|
TSKEY ekey = ascScan ? win.ekey : win.skey;
|
||||||
|
@ -827,7 +827,7 @@ static bool hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul
|
||||||
int32_t code = setTimeWindowOutputBuf(pResultRowInfo, &nextWin, (scanFlag == MAIN_SCAN), &pResult, tableGroupId,
|
int32_t code = setTimeWindowOutputBuf(pResultRowInfo, &nextWin, (scanFlag == MAIN_SCAN), &pResult, tableGroupId,
|
||||||
pSup->pCtx, numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo);
|
pSup->pCtx, numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo);
|
||||||
if (code != TSDB_CODE_SUCCESS || pResult == NULL) {
|
if (code != TSDB_CODE_SUCCESS || pResult == NULL) {
|
||||||
T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY);
|
T_LONG_JMP(pTaskInfo->env, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
ekey = ascScan ? nextWin.ekey : nextWin.skey;
|
ekey = ascScan ? nextWin.ekey : nextWin.skey;
|
||||||
|
@ -2271,7 +2271,7 @@ static void doMergeIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultRowInfo*
|
||||||
setTimeWindowOutputBuf(pResultRowInfo, &win, (scanFlag == MAIN_SCAN), &pResult, tableGroupId, pExprSup->pCtx,
|
setTimeWindowOutputBuf(pResultRowInfo, &win, (scanFlag == MAIN_SCAN), &pResult, tableGroupId, pExprSup->pCtx,
|
||||||
numOfOutput, pExprSup->rowEntryInfoOffset, &iaInfo->aggSup, pTaskInfo);
|
numOfOutput, pExprSup->rowEntryInfoOffset, &iaInfo->aggSup, pTaskInfo);
|
||||||
if (ret != TSDB_CODE_SUCCESS || pResult == NULL) {
|
if (ret != TSDB_CODE_SUCCESS || pResult == NULL) {
|
||||||
T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY);
|
T_LONG_JMP(pTaskInfo->env, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
TSKEY ekey = ascScan ? win.ekey : win.skey;
|
TSKEY ekey = ascScan ? win.ekey : win.skey;
|
||||||
|
@ -2312,7 +2312,7 @@ static void doMergeIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultRowInfo*
|
||||||
int32_t code = outputPrevIntervalResult(pOperatorInfo, tableGroupId, pResultBlock, &win);
|
int32_t code = outputPrevIntervalResult(pOperatorInfo, tableGroupId, pResultBlock, &win);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
|
||||||
T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY);
|
T_LONG_JMP(pTaskInfo->env, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
STimeWindow nextWin = win;
|
STimeWindow nextWin = win;
|
||||||
|
@ -2329,7 +2329,7 @@ static void doMergeIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultRowInfo*
|
||||||
setTimeWindowOutputBuf(pResultRowInfo, &nextWin, (scanFlag == MAIN_SCAN), &pResult, tableGroupId,
|
setTimeWindowOutputBuf(pResultRowInfo, &nextWin, (scanFlag == MAIN_SCAN), &pResult, tableGroupId,
|
||||||
pExprSup->pCtx, numOfOutput, pExprSup->rowEntryInfoOffset, &iaInfo->aggSup, pTaskInfo);
|
pExprSup->pCtx, numOfOutput, pExprSup->rowEntryInfoOffset, &iaInfo->aggSup, pTaskInfo);
|
||||||
if (code != TSDB_CODE_SUCCESS || pResult == NULL) {
|
if (code != TSDB_CODE_SUCCESS || pResult == NULL) {
|
||||||
T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY);
|
T_LONG_JMP(pTaskInfo->env, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
ekey = ascScan ? nextWin.ekey : nextWin.skey;
|
ekey = ascScan ? nextWin.ekey : nextWin.skey;
|
||||||
|
@ -2354,7 +2354,7 @@ static void doMergeIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultRowInfo*
|
||||||
code = outputPrevIntervalResult(pOperatorInfo, tableGroupId, pResultBlock, &nextWin);
|
code = outputPrevIntervalResult(pOperatorInfo, tableGroupId, pResultBlock, &nextWin);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
|
||||||
T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY);
|
T_LONG_JMP(pTaskInfo->env, code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ static int32_t loadDataFromFilePage(tMemBucket *pMemBucket, int32_t slotIdx, SFi
|
||||||
pIdList = *(SArray **)p;
|
pIdList = *(SArray **)p;
|
||||||
} else {
|
} else {
|
||||||
taosMemoryFree(*buffer);
|
taosMemoryFree(*buffer);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t offset = 0;
|
int32_t offset = 0;
|
||||||
|
|
|
@ -2012,7 +2012,7 @@ int32_t nodesMakeList(SNodeList** ppListOut) {
|
||||||
|
|
||||||
int32_t nodesListAppend(SNodeList* pList, SNode* pNode) {
|
int32_t nodesListAppend(SNodeList* pList, SNode* pNode) {
|
||||||
if (NULL == pList || NULL == pNode) {
|
if (NULL == pList || NULL == pNode) {
|
||||||
return TSDB_CODE_FAILED;
|
return TSDB_CODE_INVALID_PARA;
|
||||||
}
|
}
|
||||||
SListCell* p = NULL;
|
SListCell* p = NULL;
|
||||||
int32_t code = nodesCalloc(1, sizeof(SListCell), (void**)&p);
|
int32_t code = nodesCalloc(1, sizeof(SListCell), (void**)&p);
|
||||||
|
|
|
@ -625,7 +625,7 @@ int32_t cloneDbVgInfo(SDBVgInfo* pSrc, SDBVgInfo** pDst) {
|
||||||
qError("taosHashPut failed, vgId:%d", vgInfo->vgId);
|
qError("taosHashPut failed, vgId:%d", vgInfo->vgId);
|
||||||
taosHashCancelIterate(pSrc->vgHash, pIter);
|
taosHashCancelIterate(pSrc->vgHash, pIter);
|
||||||
freeVgInfo(*pDst);
|
freeVgInfo(*pDst);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
pIter = taosHashIterate(pSrc->vgHash, pIter);
|
pIter = taosHashIterate(pSrc->vgHash, pIter);
|
||||||
|
|
|
@ -64,7 +64,7 @@ int32_t queryBuildUseDbOutput(SUseDbOutput *pOut, SUseDbRsp *usedbRsp) {
|
||||||
qDebug("the %dth vgroup, id %d, epNum %d, current %s port %d", i, pVgInfo->vgId, pVgInfo->epSet.numOfEps,
|
qDebug("the %dth vgroup, id %d, epNum %d, current %s port %d", i, pVgInfo->vgId, pVgInfo->epSet.numOfEps,
|
||||||
pVgInfo->epSet.eps[pVgInfo->epSet.inUse].fqdn, pVgInfo->epSet.eps[pVgInfo->epSet.inUse].port);
|
pVgInfo->epSet.eps[pVgInfo->epSet.inUse].fqdn, pVgInfo->epSet.eps[pVgInfo->epSet.inUse].port);
|
||||||
if (0 != taosHashPut(pOut->dbVgroup->vgHash, &pVgInfo->vgId, sizeof(int32_t), pVgInfo, sizeof(SVgroupInfo))) {
|
if (0 != taosHashPut(pOut->dbVgroup->vgHash, &pVgInfo->vgId, sizeof(int32_t), pVgInfo, sizeof(SVgroupInfo))) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,7 @@ void qwDestroySession(QW_FPARAMS_DEF, SQWJobInfo *pJobInfo, void* session) {
|
||||||
char id2[sizeof(qId) + sizeof(cId) + 1] = {0};
|
char id2[sizeof(qId) + sizeof(cId) + 1] = {0};
|
||||||
QW_SET_QCID(id2, qId, cId);
|
QW_SET_QCID(id2, qId, cId);
|
||||||
(void)taosHashRemove(gQueryMgmt.pJobInfo, id2, sizeof(id2));
|
(void)taosHashRemove(gQueryMgmt.pJobInfo, id2, sizeof(id2));
|
||||||
|
|
||||||
QW_TASK_DLOG_E("the whole query job removed");
|
QW_TASK_DLOG_E("the whole query job removed");
|
||||||
} else {
|
} else {
|
||||||
QW_TASK_DLOG("job not removed, remainSessions:%d, %d", taosHashGetSize(pJobInfo->pSessions), pJobInfo->memInfo->remainSession);
|
QW_TASK_DLOG("job not removed, remainSessions:%d, %d", taosHashGetSize(pJobInfo->pSessions), pJobInfo->memInfo->remainSession);
|
||||||
|
@ -136,6 +137,8 @@ int32_t qwRetrieveJobInfo(QW_FPARAMS_DEF, SQWJobInfo** ppJob) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QW_TASK_DLOG_E("job added to hash");
|
||||||
|
|
||||||
pJob = (SQWJobInfo*)taosHashAcquire(gQueryMgmt.pJobInfo, id, sizeof(id));
|
pJob = (SQWJobInfo*)taosHashAcquire(gQueryMgmt.pJobInfo, id, sizeof(id));
|
||||||
if (NULL == pJob) {
|
if (NULL == pJob) {
|
||||||
QW_TASK_ELOG_E("job not in job hash, may be dropped");
|
QW_TASK_ELOG_E("job not in job hash, may be dropped");
|
||||||
|
@ -192,6 +195,8 @@ int32_t qwInitSession(QW_FPARAMS_DEF, SQWTaskCtx *ctx, void** ppSession) {
|
||||||
break;
|
break;
|
||||||
} while (true);
|
} while (true);
|
||||||
|
|
||||||
|
QW_TASK_DLOG_E("session initialized");
|
||||||
|
|
||||||
_return:
|
_return:
|
||||||
|
|
||||||
if (NULL != pJob) {
|
if (NULL != pJob) {
|
||||||
|
|
|
@ -73,7 +73,7 @@ int32_t qwBuildAndSendQueryRsp(int32_t rspType, SRpcHandleInfo *pConn, int32_t c
|
||||||
int32_t msgSize = tSerializeSQueryTableRsp(NULL, 0, &rsp);
|
int32_t msgSize = tSerializeSQueryTableRsp(NULL, 0, &rsp);
|
||||||
if (msgSize < 0) {
|
if (msgSize < 0) {
|
||||||
qError("tSerializeSQueryTableRsp failed");
|
qError("tSerializeSQueryTableRsp failed");
|
||||||
QW_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_RET(msgSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *pRsp = rpcMallocCont(msgSize);
|
void *pRsp = rpcMallocCont(msgSize);
|
||||||
|
@ -82,9 +82,10 @@ int32_t qwBuildAndSendQueryRsp(int32_t rspType, SRpcHandleInfo *pConn, int32_t c
|
||||||
QW_RET(terrno);
|
QW_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tSerializeSQueryTableRsp(pRsp, msgSize, &rsp) < 0) {
|
msgSize = tSerializeSQueryTableRsp(pRsp, msgSize, &rsp);
|
||||||
|
if (msgSize < 0) {
|
||||||
qError("tSerializeSQueryTableRsp %d failed", msgSize);
|
qError("tSerializeSQueryTableRsp %d failed", msgSize);
|
||||||
QW_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_RET(msgSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
SRpcMsg rpcRsp = {
|
SRpcMsg rpcRsp = {
|
||||||
|
@ -245,7 +246,7 @@ int32_t qwBuildAndSendDropMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
|
||||||
int32_t msgSize = tSerializeSTaskDropReq(NULL, 0, &qMsg);
|
int32_t msgSize = tSerializeSTaskDropReq(NULL, 0, &qMsg);
|
||||||
if (msgSize < 0) {
|
if (msgSize < 0) {
|
||||||
QW_SCH_TASK_ELOG("tSerializeSTaskDropReq get size, msgSize:%d", msgSize);
|
QW_SCH_TASK_ELOG("tSerializeSTaskDropReq get size, msgSize:%d", msgSize);
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(msgSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *msg = rpcMallocCont(msgSize);
|
void *msg = rpcMallocCont(msgSize);
|
||||||
|
@ -254,10 +255,11 @@ int32_t qwBuildAndSendDropMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
|
||||||
QW_ERR_RET(terrno);
|
QW_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tSerializeSTaskDropReq(msg, msgSize, &qMsg) < 0) {
|
msgSize = tSerializeSTaskDropReq(msg, msgSize, &qMsg);
|
||||||
|
if (msgSize < 0) {
|
||||||
QW_SCH_TASK_ELOG("tSerializeSTaskDropReq failed, msgSize:%d", msgSize);
|
QW_SCH_TASK_ELOG("tSerializeSTaskDropReq failed, msgSize:%d", msgSize);
|
||||||
rpcFreeCont(msg);
|
rpcFreeCont(msg);
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(msgSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
SRpcMsg pNewMsg = {
|
SRpcMsg pNewMsg = {
|
||||||
|
@ -283,7 +285,7 @@ int32_t qwBuildAndSendCQueryMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
|
||||||
SQueryContinueReq *req = (SQueryContinueReq *)rpcMallocCont(sizeof(SQueryContinueReq));
|
SQueryContinueReq *req = (SQueryContinueReq *)rpcMallocCont(sizeof(SQueryContinueReq));
|
||||||
if (NULL == req) {
|
if (NULL == req) {
|
||||||
QW_SCH_TASK_ELOG("rpcMallocCont %d failed", (int32_t)sizeof(SQueryContinueReq));
|
QW_SCH_TASK_ELOG("rpcMallocCont %d failed", (int32_t)sizeof(SQueryContinueReq));
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
req->header.vgId = mgmt->nodeId;
|
req->header.vgId = mgmt->nodeId;
|
||||||
|
@ -326,7 +328,7 @@ int32_t qwRegisterQueryBrokenLinkArg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
|
||||||
int32_t msgSize = tSerializeSTaskDropReq(NULL, 0, &qMsg);
|
int32_t msgSize = tSerializeSTaskDropReq(NULL, 0, &qMsg);
|
||||||
if (msgSize < 0) {
|
if (msgSize < 0) {
|
||||||
QW_SCH_TASK_ELOG("tSerializeSTaskDropReq get size, msgSize:%d", msgSize);
|
QW_SCH_TASK_ELOG("tSerializeSTaskDropReq get size, msgSize:%d", msgSize);
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(msgSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *msg = rpcMallocCont(msgSize);
|
void *msg = rpcMallocCont(msgSize);
|
||||||
|
@ -335,10 +337,11 @@ int32_t qwRegisterQueryBrokenLinkArg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
|
||||||
QW_ERR_RET(terrno);
|
QW_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tSerializeSTaskDropReq(msg, msgSize, &qMsg) < 0) {
|
msgSize = tSerializeSTaskDropReq(msg, msgSize, &qMsg);
|
||||||
|
if (msgSize < 0) {
|
||||||
QW_SCH_TASK_ELOG("tSerializeSTaskDropReq failed, msgSize:%d", msgSize);
|
QW_SCH_TASK_ELOG("tSerializeSTaskDropReq failed, msgSize:%d", msgSize);
|
||||||
rpcFreeCont(msg);
|
rpcFreeCont(msg);
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(msgSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
SRpcMsg brokenMsg = {
|
SRpcMsg brokenMsg = {
|
||||||
|
@ -362,17 +365,19 @@ int32_t qwRegisterHbBrokenLinkArg(SQWorker *mgmt, uint64_t clientId, SRpcHandleI
|
||||||
int32_t msgSize = tSerializeSSchedulerHbReq(NULL, 0, &req);
|
int32_t msgSize = tSerializeSSchedulerHbReq(NULL, 0, &req);
|
||||||
if (msgSize < 0) {
|
if (msgSize < 0) {
|
||||||
QW_SCH_ELOG("tSerializeSSchedulerHbReq hbReq failed, size:%d", msgSize);
|
QW_SCH_ELOG("tSerializeSSchedulerHbReq hbReq failed, size:%d", msgSize);
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(msgSize);
|
||||||
}
|
}
|
||||||
void *msg = rpcMallocCont(msgSize);
|
void *msg = rpcMallocCont(msgSize);
|
||||||
if (NULL == msg) {
|
if (NULL == msg) {
|
||||||
QW_SCH_ELOG("calloc %d failed", msgSize);
|
QW_SCH_ELOG("calloc %d failed", msgSize);
|
||||||
QW_ERR_RET(terrno);
|
QW_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
if (tSerializeSSchedulerHbReq(msg, msgSize, &req) < 0) {
|
|
||||||
|
msgSize = tSerializeSSchedulerHbReq(msg, msgSize, &req);
|
||||||
|
if (msgSize < 0) {
|
||||||
QW_SCH_ELOG("tSerializeSSchedulerHbReq hbReq failed, size:%d", msgSize);
|
QW_SCH_ELOG("tSerializeSSchedulerHbReq hbReq failed, size:%d", msgSize);
|
||||||
rpcFreeCont(msg);
|
rpcFreeCont(msg);
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(msgSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
SRpcMsg brokenMsg = {
|
SRpcMsg brokenMsg = {
|
||||||
|
|
|
@ -89,7 +89,7 @@ int32_t qwAddSchedulerImpl(SQWorker *mgmt, uint64_t clientId, int32_t rwType) {
|
||||||
|
|
||||||
QW_SCH_ELOG("taosHashPut new sch to scheduleHash failed, errno:%d", errno);
|
QW_SCH_ELOG("taosHashPut new sch to scheduleHash failed, errno:%d", errno);
|
||||||
taosHashCleanup(newSch.tasksHash);
|
taosHashCleanup(newSch.tasksHash);
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosHashCleanup(newSch.tasksHash);
|
taosHashCleanup(newSch.tasksHash);
|
||||||
|
@ -174,7 +174,7 @@ int32_t qwAddTaskStatusImpl(QW_FPARAMS_DEF, SQWSchStatus *sch, int32_t rwType, i
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QW_TASK_ELOG("taosHashPut to tasksHash failed, error:%x - %s", code, tstrerror(code));
|
QW_TASK_ELOG("taosHashPut to tasksHash failed, error:%x - %s", code, tstrerror(code));
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QW_UNLOCK(QW_WRITE, &sch->tasksLock);
|
QW_UNLOCK(QW_WRITE, &sch->tasksLock);
|
||||||
|
@ -254,7 +254,7 @@ int32_t qwAddTaskCtxImpl(QW_FPARAMS_DEF, bool acquire, SQWTaskCtx **ctx) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QW_TASK_ELOG("taosHashPut to ctxHash failed, error:%x", code);
|
QW_TASK_ELOG("taosHashPut to ctxHash failed, error:%x", code);
|
||||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_RET(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -665,7 +665,7 @@ int32_t qwOpenRef(void) {
|
||||||
if (gQwMgmt.qwRef < 0) {
|
if (gQwMgmt.qwRef < 0) {
|
||||||
taosWUnLockLatch(&gQwMgmt.lock);
|
taosWUnLockLatch(&gQwMgmt.lock);
|
||||||
qError("init qworker ref failed");
|
qError("init qworker ref failed");
|
||||||
QW_RET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_RET(gQwMgmt.qwRef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
taosWUnLockLatch(&gQwMgmt.lock);
|
taosWUnLockLatch(&gQwMgmt.lock);
|
||||||
|
|
|
@ -1400,7 +1400,7 @@ int32_t qWorkerInit(int8_t nodeType, int32_t nodeId, void **qWorkerMgmt, const S
|
||||||
mgmt->timer = taosTmrInit(0, 0, 0, "qworker");
|
mgmt->timer = taosTmrInit(0, 0, 0, "qworker");
|
||||||
if (NULL == mgmt->timer) {
|
if (NULL == mgmt->timer) {
|
||||||
qError("init timer failed, error:%s", tstrerror(terrno));
|
qError("init timer failed, error:%s", tstrerror(terrno));
|
||||||
QW_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_JRET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
mgmt->nodeType = nodeType;
|
mgmt->nodeType = nodeType;
|
||||||
|
@ -1423,7 +1423,7 @@ int32_t qWorkerInit(int8_t nodeType, int32_t nodeId, void **qWorkerMgmt, const S
|
||||||
mgmt->hbTimer = taosTmrStart(qwProcessHbTimerEvent, QW_DEFAULT_HEARTBEAT_MSEC, (void *)param, mgmt->timer);
|
mgmt->hbTimer = taosTmrStart(qwProcessHbTimerEvent, QW_DEFAULT_HEARTBEAT_MSEC, (void *)param, mgmt->timer);
|
||||||
if (NULL == mgmt->hbTimer) {
|
if (NULL == mgmt->hbTimer) {
|
||||||
qError("start hb timer failed");
|
qError("start hb timer failed");
|
||||||
QW_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
QW_ERR_JRET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
QW_ERR_JRET(qExecutorInit());
|
QW_ERR_JRET(qExecutorInit());
|
||||||
|
|
|
@ -51,7 +51,6 @@ int32_t sclCreateColumnInfoData(SDataType *pType, int32_t numOfRows, SScalarPara
|
||||||
|
|
||||||
int32_t code = colInfoDataEnsureCapacity(pColumnData, numOfRows, true);
|
int32_t code = colInfoDataEnsureCapacity(pColumnData, numOfRows, true);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
colDataDestroy(pColumnData);
|
colDataDestroy(pColumnData);
|
||||||
taosMemoryFree(pColumnData);
|
taosMemoryFree(pColumnData);
|
||||||
return terrno;
|
return terrno;
|
||||||
|
@ -1235,7 +1234,7 @@ EDealRes sclRewriteFunction(SNode **pNode, SScalarCtx *ctx) {
|
||||||
sclError("calloc %d failed", len);
|
sclError("calloc %d failed", len);
|
||||||
sclFreeParam(&output);
|
sclFreeParam(&output);
|
||||||
nodesDestroyNode((SNode *)res);
|
nodesDestroyNode((SNode *)res);
|
||||||
ctx->code = TSDB_CODE_OUT_OF_MEMORY;
|
ctx->code = terrno;
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
(void)memcpy(res->datum.p, output.columnData->pData, len);
|
(void)memcpy(res->datum.p, output.columnData->pData, len);
|
||||||
|
@ -1246,7 +1245,7 @@ EDealRes sclRewriteFunction(SNode **pNode, SScalarCtx *ctx) {
|
||||||
sclError("calloc %d failed", (int)(varDataTLen(output.columnData->pData) + 1));
|
sclError("calloc %d failed", (int)(varDataTLen(output.columnData->pData) + 1));
|
||||||
sclFreeParam(&output);
|
sclFreeParam(&output);
|
||||||
nodesDestroyNode((SNode *)res);
|
nodesDestroyNode((SNode *)res);
|
||||||
ctx->code = TSDB_CODE_OUT_OF_MEMORY;
|
ctx->code = terrno;
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
(void)memcpy(res->datum.p, output.columnData->pData, varDataTLen(output.columnData->pData));
|
(void)memcpy(res->datum.p, output.columnData->pData, varDataTLen(output.columnData->pData));
|
||||||
|
@ -1440,7 +1439,7 @@ EDealRes sclRewriteCaseWhen(SNode **pNode, SScalarCtx *ctx) {
|
||||||
sclError("calloc %d failed", (int)(varDataTLen(output.columnData->pData) + 1));
|
sclError("calloc %d failed", (int)(varDataTLen(output.columnData->pData) + 1));
|
||||||
sclFreeParam(&output);
|
sclFreeParam(&output);
|
||||||
nodesDestroyNode((SNode *)res);
|
nodesDestroyNode((SNode *)res);
|
||||||
ctx->code = TSDB_CODE_OUT_OF_MEMORY;
|
ctx->code = terrno;
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
(void)memcpy(res->datum.p, output.columnData->pData, varDataTLen(output.columnData->pData));
|
(void)memcpy(res->datum.p, output.columnData->pData, varDataTLen(output.columnData->pData));
|
||||||
|
@ -1494,7 +1493,7 @@ EDealRes sclWalkFunction(SNode *pNode, SScalarCtx *ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosHashPut(ctx->pRes, &pNode, POINTER_BYTES, &output, sizeof(output))) {
|
if (taosHashPut(ctx->pRes, &pNode, POINTER_BYTES, &output, sizeof(output))) {
|
||||||
ctx->code = TSDB_CODE_OUT_OF_MEMORY;
|
ctx->code = terrno;
|
||||||
sclFreeParam(&output);
|
sclFreeParam(&output);
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1513,7 +1512,7 @@ EDealRes sclWalkLogic(SNode *pNode, SScalarCtx *ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosHashPut(ctx->pRes, &pNode, POINTER_BYTES, &output, sizeof(output))) {
|
if (taosHashPut(ctx->pRes, &pNode, POINTER_BYTES, &output, sizeof(output))) {
|
||||||
ctx->code = TSDB_CODE_OUT_OF_MEMORY;
|
ctx->code = terrno;
|
||||||
sclFreeParam(&output);
|
sclFreeParam(&output);
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1532,7 +1531,7 @@ EDealRes sclWalkOperator(SNode *pNode, SScalarCtx *ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosHashPut(ctx->pRes, &pNode, POINTER_BYTES, &output, sizeof(output))) {
|
if (taosHashPut(ctx->pRes, &pNode, POINTER_BYTES, &output, sizeof(output))) {
|
||||||
ctx->code = TSDB_CODE_OUT_OF_MEMORY;
|
ctx->code = terrno;
|
||||||
sclFreeParam(&output);
|
sclFreeParam(&output);
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1613,7 +1612,7 @@ EDealRes sclWalkCaseWhen(SNode *pNode, SScalarCtx *ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosHashPut(ctx->pRes, &pNode, POINTER_BYTES, &output, sizeof(output))) {
|
if (taosHashPut(ctx->pRes, &pNode, POINTER_BYTES, &output, sizeof(output))) {
|
||||||
ctx->code = TSDB_CODE_OUT_OF_MEMORY;
|
ctx->code = terrno;
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1078,7 +1078,7 @@ int32_t vectorConvertSingleCol(SScalarParam *input, SScalarParam *output, int32_
|
||||||
|
|
||||||
int32_t code = sclCreateColumnInfoData(&t, input->numOfRows, output);
|
int32_t code = sclCreateColumnInfoData(&t, input->numOfRows, output);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = vectorConvertSingleColImpl(input, output, NULL, startIndex, numOfRows);
|
code = vectorConvertSingleColImpl(input, output, NULL, startIndex, numOfRows);
|
||||||
|
|
|
@ -74,7 +74,7 @@ int32_t flttMakeValueNode(SNode **pNode, int32_t dataType, void *value) {
|
||||||
if (IS_VAR_DATA_TYPE(dataType)) {
|
if (IS_VAR_DATA_TYPE(dataType)) {
|
||||||
vnode->datum.p = (char *)taosMemoryMalloc(varDataTLen(value));
|
vnode->datum.p = (char *)taosMemoryMalloc(varDataTLen(value));
|
||||||
if (NULL == vnode->datum.p) {
|
if (NULL == vnode->datum.p) {
|
||||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
FLT_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
varDataCopy(vnode->datum.p, value);
|
varDataCopy(vnode->datum.p, value);
|
||||||
vnode->node.resType.bytes = varDataLen(value);
|
vnode->node.resType.bytes = varDataLen(value);
|
||||||
|
|
|
@ -94,7 +94,7 @@ int32_t scltAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t
|
||||||
SSDataBlock *res = NULL;
|
SSDataBlock *res = NULL;
|
||||||
int32_t code = createDataBlock(&res);
|
int32_t code = createDataBlock(&res);
|
||||||
if (code != 0 || NULL == res->pDataBlock) {
|
if (code != 0 || NULL == res->pDataBlock) {
|
||||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
SCL_ERR_RET(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
SColumnInfoData idata = {0};
|
SColumnInfoData idata = {0};
|
||||||
|
@ -121,7 +121,7 @@ int32_t scltAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == taosArrayPush(pBlockList, &res)) {
|
if (NULL == taosArrayPush(pBlockList, &res)) {
|
||||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
SCL_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
*dataBlockId = taosArrayGetSize(pBlockList) - 1;
|
*dataBlockId = taosArrayGetSize(pBlockList) - 1;
|
||||||
res->info.id.blockId = *dataBlockId;
|
res->info.id.blockId = *dataBlockId;
|
||||||
|
@ -161,7 +161,7 @@ int32_t scltMakeValueNode(SNode **pNode, int32_t dataType, void *value) {
|
||||||
if (IS_VAR_DATA_TYPE(dataType)) {
|
if (IS_VAR_DATA_TYPE(dataType)) {
|
||||||
vnode->datum.p = (char *)taosMemoryMalloc(varDataTLen(value));
|
vnode->datum.p = (char *)taosMemoryMalloc(varDataTLen(value));
|
||||||
if (NULL == vnode->datum.p) {
|
if (NULL == vnode->datum.p) {
|
||||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
SCL_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
varDataCopy(vnode->datum.p, value);
|
varDataCopy(vnode->datum.p, value);
|
||||||
vnode->node.resType.bytes = varDataTLen(value);
|
vnode->node.resType.bytes = varDataTLen(value);
|
||||||
|
@ -1385,7 +1385,7 @@ int32_t makeCalculate(void *json, void *key, int32_t rightType, void *rightData,
|
||||||
|
|
||||||
SCL_ERR_RET(makeJsonArrow(&src, &opNode, json, (char *)key));
|
SCL_ERR_RET(makeJsonArrow(&src, &opNode, json, (char *)key));
|
||||||
if (NULL == taosArrayPush(blockList, &src)) {
|
if (NULL == taosArrayPush(blockList, &src)) {
|
||||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
SCL_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
SCL_ERR_RET(makeOperator(&opNode, blockList, opType, rightType, rightData, isReverse));
|
SCL_ERR_RET(makeOperator(&opNode, blockList, opType, rightType, rightData, isReverse));
|
||||||
|
@ -2483,7 +2483,7 @@ TEST(columnTest, greater_and_lower) {
|
||||||
int32_t scltMakeDataBlock(SScalarParam **pInput, int32_t type, void *pVal, int32_t num, bool setVal) {
|
int32_t scltMakeDataBlock(SScalarParam **pInput, int32_t type, void *pVal, int32_t num, bool setVal) {
|
||||||
SScalarParam *input = (SScalarParam *)taosMemoryCalloc(1, sizeof(SScalarParam));
|
SScalarParam *input = (SScalarParam *)taosMemoryCalloc(1, sizeof(SScalarParam));
|
||||||
if (NULL == input) {
|
if (NULL == input) {
|
||||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
SCL_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
int32_t bytes;
|
int32_t bytes;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -2515,7 +2515,7 @@ int32_t scltMakeDataBlock(SScalarParam **pInput, int32_t type, void *pVal, int32
|
||||||
|
|
||||||
input->columnData = (SColumnInfoData *)taosMemoryCalloc(1, sizeof(SColumnInfoData));
|
input->columnData = (SColumnInfoData *)taosMemoryCalloc(1, sizeof(SColumnInfoData));
|
||||||
if (NULL == input->columnData) {
|
if (NULL == input->columnData) {
|
||||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
SCL_ERR_RET(terrno);
|
||||||
}
|
}
|
||||||
input->numOfRows = num;
|
input->numOfRows = num;
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,6 @@ void* rpcMallocCont(int64_t contLen) {
|
||||||
char* start = taosMemoryCalloc(1, size);
|
char* start = taosMemoryCalloc(1, size);
|
||||||
if (start == NULL) {
|
if (start == NULL) {
|
||||||
tError("failed to malloc msg, size:%" PRId64, size);
|
tError("failed to malloc msg, size:%" PRId64, size);
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
tTrace("malloc mem:%p size:%" PRId64, start, size);
|
tTrace("malloc mem:%p size:%" PRId64, start, size);
|
||||||
|
|
|
@ -487,13 +487,15 @@ enum {
|
||||||
#define MP_CHECK_QUOTA(_pool, _job, _size) do { \
|
#define MP_CHECK_QUOTA(_pool, _job, _size) do { \
|
||||||
if (*(_pool)->cfg.jobQuota > 0) { \
|
if (*(_pool)->cfg.jobQuota > 0) { \
|
||||||
int64_t cAllocSize = atomic_add_fetch_64(&(_job)->job.allocMemSize, (_size)); \
|
int64_t cAllocSize = atomic_add_fetch_64(&(_job)->job.allocMemSize, (_size)); \
|
||||||
if ((cAllocSize / 1048576L) > *(_pool)->cfg.jobQuota) { \
|
if (cAllocSize > (*(_pool)->cfg.jobQuota * 1048576L)) { \
|
||||||
uWarn("job 0x%" PRIx64 " allocSize %" PRId64 " is over than quota %dMB", (_job)->job.jobId, cAllocSize, *(_pool)->cfg.jobQuota); \
|
uWarn("job 0x%" PRIx64 " remainSession:%d allocSize %" PRId64 " is over than quota %dMB", (_job)->job.jobId, (_job)->job.remainSession, cAllocSize, *(_pool)->cfg.jobQuota); \
|
||||||
(_pool)->cfg.cb.reachFp(pJob->job.jobId, (_job)->job.clientId, TSDB_CODE_QRY_REACH_QMEM_THRESHOLD); \
|
(_pool)->cfg.cb.reachFp(pJob->job.jobId, (_job)->job.clientId, TSDB_CODE_QRY_REACH_QMEM_THRESHOLD); \
|
||||||
mpSchedTrim(NULL); \
|
mpSchedTrim(NULL); \
|
||||||
terrno = TSDB_CODE_QRY_REACH_QMEM_THRESHOLD; \
|
terrno = TSDB_CODE_QRY_REACH_QMEM_THRESHOLD; \
|
||||||
return NULL; \
|
return NULL; \
|
||||||
} \
|
} else { \
|
||||||
|
uDebug("job 0x%" PRIx64 " remainSession:%d allocSize %" PRId64 " is lower than quota %dMB", (_job)->job.jobId, (_job)->job.remainSession, cAllocSize, *(_pool)->cfg.jobQuota); \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
if (atomic_load_64(&tsCurrentAvailMemorySize) <= ((_pool)->cfg.reserveSize + (_size))) { \
|
if (atomic_load_64(&tsCurrentAvailMemorySize) <= ((_pool)->cfg.reserveSize + (_size))) { \
|
||||||
uWarn("%s pool sysAvailMemSize %" PRId64 " can't alloc %" PRId64" while keeping reserveSize %" PRId64 " bytes", \
|
uWarn("%s pool sysAvailMemSize %" PRId64 " can't alloc %" PRId64" while keeping reserveSize %" PRId64 " bytes", \
|
||||||
|
|
|
@ -349,9 +349,11 @@ static SPageInfo* getPageInfoFromPayload(void* page) {
|
||||||
|
|
||||||
int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int64_t inMemBufSize, const char* id,
|
int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int64_t inMemBufSize, const char* id,
|
||||||
const char* dir) {
|
const char* dir) {
|
||||||
|
int32_t code = 0;
|
||||||
*pBuf = NULL;
|
*pBuf = NULL;
|
||||||
SDiskbasedBuf* pPBuf = taosMemoryCalloc(1, sizeof(SDiskbasedBuf));
|
SDiskbasedBuf* pPBuf = taosMemoryCalloc(1, sizeof(SDiskbasedBuf));
|
||||||
if (pPBuf == NULL) {
|
if (pPBuf == NULL) {
|
||||||
|
code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,12 +364,14 @@ int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int64_t inMem
|
||||||
pPBuf->pFile = NULL;
|
pPBuf->pFile = NULL;
|
||||||
pPBuf->id = taosStrdup(id);
|
pPBuf->id = taosStrdup(id);
|
||||||
if (id != NULL && pPBuf->id == NULL) {
|
if (id != NULL && pPBuf->id == NULL) {
|
||||||
|
code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
pPBuf->fileSize = 0;
|
pPBuf->fileSize = 0;
|
||||||
pPBuf->pFree = taosArrayInit(4, sizeof(SFreeListItem));
|
pPBuf->pFree = taosArrayInit(4, sizeof(SFreeListItem));
|
||||||
pPBuf->freePgList = tdListNew(POINTER_BYTES);
|
pPBuf->freePgList = tdListNew(POINTER_BYTES);
|
||||||
if (pPBuf->pFree == NULL || pPBuf->freePgList == NULL) {
|
if (pPBuf->pFree == NULL || pPBuf->freePgList == NULL) {
|
||||||
|
code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,6 +383,7 @@ int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int64_t inMem
|
||||||
pPBuf->inMemPages = inMemBufSize / pagesize; // maximum allowed pages, it is a soft limit.
|
pPBuf->inMemPages = inMemBufSize / pagesize; // maximum allowed pages, it is a soft limit.
|
||||||
pPBuf->lruList = tdListNew(POINTER_BYTES);
|
pPBuf->lruList = tdListNew(POINTER_BYTES);
|
||||||
if (pPBuf->lruList == NULL) {
|
if (pPBuf->lruList == NULL) {
|
||||||
|
code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,17 +391,20 @@ int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int64_t inMem
|
||||||
_hash_fn_t fn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT);
|
_hash_fn_t fn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT);
|
||||||
pPBuf->pIdList = taosArrayInit(4, POINTER_BYTES);
|
pPBuf->pIdList = taosArrayInit(4, POINTER_BYTES);
|
||||||
if (pPBuf->pIdList == NULL) {
|
if (pPBuf->pIdList == NULL) {
|
||||||
|
code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPBuf->all = tSimpleHashInit(64, fn);
|
pPBuf->all = tSimpleHashInit(64, fn);
|
||||||
if (pPBuf->all == NULL) {
|
if (pPBuf->all == NULL) {
|
||||||
|
code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPBuf->prefix = (char*)dir;
|
pPBuf->prefix = (char*)dir;
|
||||||
pPBuf->emptyDummyIdList = taosArrayInit(1, sizeof(int32_t));
|
pPBuf->emptyDummyIdList = taosArrayInit(1, sizeof(int32_t));
|
||||||
if (pPBuf->emptyDummyIdList == NULL) {
|
if (pPBuf->emptyDummyIdList == NULL) {
|
||||||
|
code = terrno;
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,7 +417,7 @@ int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int64_t inMem
|
||||||
_error:
|
_error:
|
||||||
destroyDiskbasedBuf(pPBuf);
|
destroyDiskbasedBuf(pPBuf);
|
||||||
*pBuf = NULL;
|
*pBuf = NULL;
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char* doExtractPage(SDiskbasedBuf* pBuf) {
|
static char* doExtractPage(SDiskbasedBuf* pBuf) {
|
||||||
|
|
|
@ -0,0 +1,130 @@
|
||||||
|
###################################################################
|
||||||
|
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is proprietary and confidential to TAOS Technologies.
|
||||||
|
# No part of this file may be reproduced, stored, transmitted,
|
||||||
|
# disclosed or used in any form or by any means other than as
|
||||||
|
# expressly provided by the written permission from Jianhui Tao
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import re
|
||||||
|
from util.log import *
|
||||||
|
from util.cases import *
|
||||||
|
from util.sql import *
|
||||||
|
from util.common import *
|
||||||
|
from util.sqlset import *
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
updatecfgDict = {'queryUseMemoryPool':'true','minReservedMemorySize':1025, 'singleQueryMaxMemorySize': 0}
|
||||||
|
def init(self, conn, logSql, replicaVar=1):
|
||||||
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
self.setsql = TDSetSql()
|
||||||
|
self.perf_param_list = ['apps','connections','consumers','queries','trans']
|
||||||
|
self.dbname = "db"
|
||||||
|
self.vgroups = 4
|
||||||
|
self.stbname = f'`{tdCom.getLongName(5)}`'
|
||||||
|
self.tbname = f'`{tdCom.getLongName(3)}`'
|
||||||
|
self.db_param = {
|
||||||
|
"database":f"{self.dbname}",
|
||||||
|
"buffer":100,
|
||||||
|
"vgroups":self.vgroups,
|
||||||
|
"stt_trigger":1,
|
||||||
|
"tsdb_pagesize":16
|
||||||
|
}
|
||||||
|
|
||||||
|
def update_cfg(self, use_mpool = 1, min_rsize = 0, single_msize = 0):
|
||||||
|
updatecfgDict = {'queryUseMemoryPool':'{use_mpool}','minReservedMemorySize': min_rsize, 'singleQueryMaxMemorySize': single_msize}
|
||||||
|
tdDnodes.stop(1)
|
||||||
|
tdDnodes.deploy(1)
|
||||||
|
tdDnodes.start(1)
|
||||||
|
|
||||||
|
def alter_cfg(self, use_mpool = 1, min_rsize = 0, single_msize = 0):
|
||||||
|
tdSql.error(f"alter dnode 1 'queryUseMemoryPool' '{use_mpool}'")
|
||||||
|
tdSql.error(f"alter dnode 1 'minReservedMemorySize' '{min_rsize}'")
|
||||||
|
tdSql.error(f"alter dnode 1 'singleQueryMaxMemorySize' '{single_msize}'")
|
||||||
|
|
||||||
|
def variables_check(self, err_case = 0, use_mpool = 1, min_rsize = 0, single_msize = 0):
|
||||||
|
if err_case == 1:
|
||||||
|
tdSql.error("show dnode 1 variables like 'queryUseMemoryPool'")
|
||||||
|
else:
|
||||||
|
tdSql.query("show dnode 1 variables like 'queryUseMemoryPool'")
|
||||||
|
tdSql.checkRows(1)
|
||||||
|
tdSql.checkData(0, 0, 1)
|
||||||
|
tdSql.checkData(0, 1, 'queryUseMemoryPool')
|
||||||
|
tdSql.checkData(0, 2, use_mpool)
|
||||||
|
|
||||||
|
if err_case == 1:
|
||||||
|
tdSql.error("show dnode 1 variables like 'minReservedMemorySize'")
|
||||||
|
else:
|
||||||
|
tdSql.query("show dnode 1 variables like 'minReservedMemorySize'")
|
||||||
|
tdSql.checkRows(1)
|
||||||
|
tdSql.checkData(0, 0, 1)
|
||||||
|
tdSql.checkData(0, 1, 'minReservedMemorySize')
|
||||||
|
tdSql.checkData(0, 2, min_rsize)
|
||||||
|
|
||||||
|
if err_case == 1:
|
||||||
|
tdSql.error("show dnode 1 variables like 'singleQueryMaxMemorySize'")
|
||||||
|
else:
|
||||||
|
tdSql.query("show dnode 1 variables like 'singleQueryMaxMemorySize'")
|
||||||
|
tdSql.checkRows(1)
|
||||||
|
tdSql.checkData(0, 0, 1)
|
||||||
|
tdSql.checkData(0, 1, 'singleQueryMaxMemorySize')
|
||||||
|
tdSql.checkData(0, 2, single_msize)
|
||||||
|
|
||||||
|
|
||||||
|
def cfg_check(self):
|
||||||
|
tdLog.info(f'[disable pool] start')
|
||||||
|
self.update_cfg(0, 1024, 0)
|
||||||
|
self.variables_check(0, 0, 1024, 0)
|
||||||
|
|
||||||
|
tdLog.info(f'[enable pool + up limit] start')
|
||||||
|
self.update_cfg(1, 1000000000, 1000000000)
|
||||||
|
self.variables_check(0, 1, 1000000000, 1000000000)
|
||||||
|
|
||||||
|
tdLog.info(f'[enable pool + out of reserve] start')
|
||||||
|
self.update_cfg(1, 1000000001)
|
||||||
|
self.variables_check(1)
|
||||||
|
|
||||||
|
tdLog.info(f'[enable pool + out of single] start')
|
||||||
|
self.update_cfg(1, 1000, 1000000001)
|
||||||
|
self.variables_check(1)
|
||||||
|
|
||||||
|
tdLog.info(f'[out of pool] start')
|
||||||
|
self.update_cfg(2)
|
||||||
|
self.variables_check(1)
|
||||||
|
|
||||||
|
def alter_check(self):
|
||||||
|
tdLog.info(f'[alter] start')
|
||||||
|
self.update_cfg(1, 1024, 0)
|
||||||
|
self.alter_cfg(1, 1024, 0);
|
||||||
|
|
||||||
|
def single_up_check(self):
|
||||||
|
tdLog.info(f'[low single] start')
|
||||||
|
self.update_cfg(1, 1024, 1)
|
||||||
|
tdSql.error("select *, repeat('aaaaaaaaaa',1000) from information_schema.ins_tables")
|
||||||
|
|
||||||
|
tdLog.info(f'[normal single] start')
|
||||||
|
self.update_cfg(1, 1024, 100)
|
||||||
|
tdSql.query("select *, repeat('aaaaaaaaaa',1000) from information_schema.ins_tables")
|
||||||
|
|
||||||
|
def too_big_reserve(self):
|
||||||
|
tdLog.info(f'[too big reserve] start')
|
||||||
|
self.update_cfg(1, 1024000)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.cfg_check()
|
||||||
|
self.alter_check()
|
||||||
|
self.single_up_check()
|
||||||
|
self.too_big_reserve()
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
Loading…
Reference in New Issue