From 8dd7f36993b5df2830f26a72d06d28ad5ce6b85a Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 11 Jul 2023 16:19:38 +0800 Subject: [PATCH] fix:set firset version to reqOffset of response --- source/client/src/clientTmq.c | 2 +- source/dnode/vnode/src/tq/tqUtil.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index 807e6cb53b..50a42d547c 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -2276,7 +2276,7 @@ int64_t tmq_get_vgroup_offset(TAOS_RES* res) { return pRspObj->rsp.reqOffset.version; } } else{ - tscError("invalid tmqtype:%d", *(int8_t*)res); + tscError("invalid tmq type:%d", *(int8_t*)res); } // data from tsdb, no valid offset info diff --git a/source/dnode/vnode/src/tq/tqUtil.c b/source/dnode/vnode/src/tq/tqUtil.c index 7768f71c61..8e9f043f62 100644 --- a/source/dnode/vnode/src/tq/tqUtil.c +++ b/source/dnode/vnode/src/tq/tqUtil.c @@ -171,6 +171,7 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle, SMqDataRsp dataRsp = {0}; tqInitDataRsp(&dataRsp, pRequest); + dataRsp.reqOffset.type = pOffset->type; // stroe origin type for getting offset in tmq_get_vgroup_offset qSetTaskId(pHandle->execHandle.task, consumerId, pRequest->reqId); int code = tqScanData(pTq, pHandle, &dataRsp, pOffset); @@ -191,7 +192,7 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle, } taosWUnLockLatch(&pTq->lock); } - setRequestVersion(pOffset, pOffset->version); + setRequestVersion(&dataRsp.reqOffset, pOffset->version); code = tqSendDataRsp(pHandle, pMsg, pRequest, (SMqDataRsp*)&dataRsp, TMQ_MSG_TYPE__POLL_RSP, vgId); end : { -- GitLab