Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e7418724
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e7418724
编写于
6月 29, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tmq): offset
上级
0f0fe627
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
10 deletion
+12
-10
source/client/src/tmq.c
source/client/src/tmq.c
+8
-8
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-2
tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
+2
-0
未找到文件。
source/client/src/tmq.c
浏览文件 @
e7418724
...
...
@@ -1124,10 +1124,10 @@ int32_t tmqPollCb(void* param, const SDataBuf* pMsg, int32_t code) {
pRspWrapper
->
topicHandle
=
pTopic
;
if
(
rspType
==
TMQ_MSG_TYPE__POLL_RSP
)
{
memcpy
(
&
pRspWrapper
->
dataRsp
,
pMsg
->
pData
,
sizeof
(
SMqRspHead
));
SDecoder
decoder
;
tDecoderInit
(
&
decoder
,
POINTER_SHIFT
(
pMsg
->
pData
,
sizeof
(
SMqRspHead
)),
pMsg
->
len
-
sizeof
(
SMqRspHead
));
tDecodeSMqDataRsp
(
&
decoder
,
&
pRspWrapper
->
dataRsp
);
memcpy
(
&
pRspWrapper
->
dataRsp
,
pMsg
->
pData
,
sizeof
(
SMqRspHead
));
/*tDecodeSMqDataBlkRsp(POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), &pRspWrapper->dataRsp);*/
}
else
{
ASSERT
(
rspType
==
TMQ_MSG_TYPE__POLL_META_RSP
);
...
...
@@ -1138,7 +1138,7 @@ int32_t tmqPollCb(void* param, const SDataBuf* pMsg, int32_t code) {
taosMemoryFree
(
pMsg
->
pData
);
tscDebug
(
"consumer %ld recv poll: vg %d, req offset %ld, rsp offset %ld, type %d"
,
tmq
->
consumerId
,
pVg
->
vgId
,
pRspWrapper
->
dataRsp
.
reqOffset
,
pRspWrapper
->
dataRsp
.
rspOffset
,
rspType
);
pRspWrapper
->
dataRsp
.
reqOffset
.
version
,
pRspWrapper
->
dataRsp
.
rspOffset
.
version
,
rspType
);
taosWriteQitem
(
tmq
->
mqueue
,
pRspWrapper
);
tsem_post
(
&
tmq
->
rspSem
);
...
...
@@ -1203,17 +1203,17 @@ bool tmqUpdateEp2(tmq_t* tmq, int32_t epoch, SMqAskEpRsp* pRsp) {
for
(
int32_t
j
=
0
;
j
<
vgNumGet
;
j
++
)
{
SMqSubVgEp
*
pVgEp
=
taosArrayGet
(
pTopicEp
->
vgs
,
j
);
sprintf
(
vgKey
,
"%s:%d"
,
topic
.
topicName
,
pVgEp
->
vgId
);
int64_t
*
pOffset
=
taosHashGet
(
pHash
,
vgKey
,
strlen
(
vgKey
));
int64_t
offset
=
tmq
->
resetOffsetCfg
;
STqOffsetVal
*
pOffset
=
taosHashGet
(
pHash
,
vgKey
,
strlen
(
vgKey
));
STqOffsetVal
offsetNew
=
{.
type
=
tmq
->
resetOffsetCfg
}
;
if
(
pOffset
!=
NULL
)
{
offset
=
*
pOffset
;
offset
New
=
*
pOffset
;
}
tscDebug
(
"consumer %ld(epoch %d) offset of vg %d updated to %ld, vgKey is %s"
,
tmq
->
consumerId
,
epoch
,
pVgEp
->
vgId
,
offset
,
vgKey
);
/*tscDebug("consumer %ld(epoch %d) offset of vg %d updated to %ld, vgKey is %s", tmq->consumerId, epoch,*/
/*pVgEp->vgId, offset, vgKey);*/
SMqClientVg
clientVg
=
{
.
pollCnt
=
0
,
.
currentOffsetNew
.
type
=
tmq
->
resetOffsetCfg
,
.
currentOffsetNew
=
offsetNew
,
.
vgId
=
pVgEp
->
vgId
,
.
epSet
=
pVgEp
->
epSet
,
.
vgStatus
=
TMQ_VG_STATUS__IDLE
,
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
e7418724
...
...
@@ -142,7 +142,7 @@ int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, con
void
*
abuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMqRspHead
));
SEncoder
encoder
;
tEncoderInit
(
&
encoder
,
abuf
,
t
len
);
tEncoderInit
(
&
encoder
,
abuf
,
len
);
tEncodeSMqDataRsp
(
&
encoder
,
pRsp
);
/*tEncodeSMqDataBlkRsp(&abuf, pRsp);*/
...
...
@@ -332,7 +332,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
if
(
tqFetchLog
(
pTq
,
pHandle
,
&
fetchVer
,
&
pHeadWithCkSum
)
<
0
)
{
// TODO add push mgr
tqOffsetResetToLog
(
&
dataRsp
.
rspOffset
,
fetchVer
);
tqOffsetResetToLog
(
&
dataRsp
.
rspOffset
,
fetchVer
-
1
);
if
(
tqSendDataRsp
(
pTq
,
pMsg
,
pReq
,
&
dataRsp
)
<
0
)
{
code
=
-
1
;
}
...
...
tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
浏览文件 @
e7418724
...
...
@@ -134,6 +134,8 @@ endi
$totalMsgCons = $totalMsgOfOneTopic + $totalMsgOfStb
$sumOfMsgCnt = $data[0][2] + $data[1][2]
if $sumOfMsgCnt != $totalMsgCons then
print total: $totalMsgCons
print sum: $sumOfMsgCnt
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录