From 9dcac195cb384934c7999641ccac16d910af14f4 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 18 Feb 2025 11:20:42 +0800 Subject: [PATCH] fix:[TS-5776]error in ci --- source/client/src/clientRawBlockWrite.c | 2 +- source/dnode/vnode/src/tq/tqScan.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/source/client/src/clientRawBlockWrite.c b/source/client/src/clientRawBlockWrite.c index 705ce14911..e99d5c2e83 100644 --- a/source/client/src/clientRawBlockWrite.c +++ b/source/client/src/clientRawBlockWrite.c @@ -2608,7 +2608,7 @@ void tmq_free_raw(tmq_raw_data raw) { raw.raw_type == RES_TYPE__TMQ_METADATA) { taosMemoryFree(raw.raw); } else if(raw.raw_type == RES_TYPE__TMQ_RAWDATA && raw.raw != NULL){ - taosMemoryFree(raw.raw - sizeof(SMqRspHead)); + taosMemoryFree(POINTER_SHIFT(raw.raw, - sizeof(SMqRspHead))); } (void)memset(terrMsg, 0, ERR_MSG_LEN); } diff --git a/source/dnode/vnode/src/tq/tqScan.c b/source/dnode/vnode/src/tq/tqScan.c index d43afc9ebd..e0c746c0e7 100644 --- a/source/dnode/vnode/src/tq/tqScan.c +++ b/source/dnode/vnode/src/tq/tqScan.c @@ -31,8 +31,9 @@ static int32_t tqAddRawDataToRsp(const void* rawData, SMqDataRsp* pRsp, int8_t p memcpy(pRetrieve->data, rawData, *(uint32_t *)rawData + INT_BYTES); TSDB_CHECK_NULL(taosArrayPush(pRsp->blockDataLen, &dataStrLen), code, lino, END, terrno); TSDB_CHECK_NULL(taosArrayPush(pRsp->blockData, &buf), code, lino, END, terrno); + pRsp->blockDataElementFree = true; - tqTrace("add block data to block array, blockDataLen:%d, blockData:%p", dataStrLen, buf); + tqTrace("tqAddRawDataToRsp add block data to block array, blockDataLen:%d, blockData:%p", dataStrLen, buf); END: if (code != TSDB_CODE_SUCCESS) { taosMemoryFree(buf); @@ -63,12 +64,13 @@ static int32_t tqAddBlockDataToRsp(const SSDataBlock* pBlock, SMqDataRsp* pRsp, TSDB_CHECK_NULL(taosArrayPush(pRsp->blockDataLen, &actualLen), code, lino, END, terrno); TSDB_CHECK_NULL(taosArrayPush(pRsp->blockData, &buf), code, lino, END, terrno); pRsp->blockDataElementFree = true; - buf = NULL; + tqTrace("tqAddBlockDataToRsp add block data to block array, blockDataLen:%d, blockData:%p", dataStrLen, buf); + END: - if (code != 0){ + if (code != TSDB_CODE_SUCCESS){ + taosMemoryFree(buf); tqError("%s failed at line %d with msg:%s", __func__, lino, tstrerror(code)); } - taosMemoryFree(buf); return code; } @@ -400,10 +402,6 @@ static void preProcessSubmitMsg(STqHandle* pHandle, const SMqPollReq* pRequest, return; } - if (pSubmitTbData->pCreateTbReq == NULL){ - continue; - } - int64_t uid = pSubmitTbData->uid; if (taosHashGet(pRequest->uidHash, &uid, LONG_BYTES) != NULL) { tqDebug("poll rawdata split,uid:%" PRId64 " is already exists", uid); @@ -416,6 +414,10 @@ static void preProcessSubmitMsg(STqHandle* pHandle, const SMqPollReq* pRequest, } } + if (pSubmitTbData->pCreateTbReq == NULL){ + continue; + } + int64_t createTime = 0; int64_t *cTime = (int64_t*)taosHashGet(pHandle->tableCreateTimeHash, &uid, LONG_BYTES); if (cTime != NULL){