From e607f5a16e7f818040a73f6a0007aeb9e961f8c7 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 2 Jun 2022 21:01:24 +0800 Subject: [PATCH 1/3] fix: add htonl to numOfBlocks --- include/common/tmsg.h | 1 + source/common/src/tmsg.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 768f02d9ba..972181f77e 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -241,6 +241,7 @@ typedef struct { int32_t schemaLen; // schema length, if length is 0, no schema exists int16_t numOfRows; // total number of rows in current submit block // head of SSubmitBlk + int32_t numOfBlocks; const void* pMsg; } SSubmitMsgIter; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 9c6c532bcd..e7ee164be7 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -35,6 +35,7 @@ int32_t tInitSubmitMsgIter(const SSubmitReq *pMsg, SSubmitMsgIter *pIter) { } pIter->totalLen = htonl(pMsg->length); + pIter->numOfBlocks = htonl(pMsg->numOfBlocks); ASSERT(pIter->totalLen > 0); pIter->len = 0; pIter->pMsg = pMsg; From 0b5cddeec6ae4dbd0b4e54c798ede5bfada1918b Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Fri, 3 Jun 2022 20:08:17 +0800 Subject: [PATCH 2/3] fix: use num of block from msg iter --- source/dnode/vnode/src/vnd/vnodeSvr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 47eaf2d5a5..136ecd41d4 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -715,8 +715,8 @@ static int vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq, in goto _exit; } - submitRsp.pArray = taosArrayInit(pSubmitReq->numOfBlocks, sizeof(SSubmitBlkRsp)); - newTbUids = taosArrayInit(pSubmitReq->numOfBlocks, sizeof(int64_t)); + submitRsp.pArray = taosArrayInit(msgIter->numOfBlocks, sizeof(SSubmitBlkRsp)); + newTbUids = taosArrayInit(msgIter->numOfBlocks, sizeof(int64_t)); if (!submitRsp.pArray) { pRsp->code = TSDB_CODE_OUT_OF_MEMORY; goto _exit; From 401610ab3c6f4560f32ea69fcb87ff88c3ebcaeb Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Fri, 3 Jun 2022 20:13:48 +0800 Subject: [PATCH 3/3] fix: use num of blocks from msg iter --- source/dnode/vnode/src/vnd/vnodeSvr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 136ecd41d4..4b0016a746 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -715,8 +715,8 @@ static int vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq, in goto _exit; } - submitRsp.pArray = taosArrayInit(msgIter->numOfBlocks, sizeof(SSubmitBlkRsp)); - newTbUids = taosArrayInit(msgIter->numOfBlocks, sizeof(int64_t)); + submitRsp.pArray = taosArrayInit(msgIter.numOfBlocks, sizeof(SSubmitBlkRsp)); + newTbUids = taosArrayInit(msgIter.numOfBlocks, sizeof(int64_t)); if (!submitRsp.pArray) { pRsp->code = TSDB_CODE_OUT_OF_MEMORY; goto _exit;