Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
91940ac7
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看板
未验证
提交
91940ac7
编写于
6月 11, 2022
作者:
L
Liu Jicong
提交者:
GitHub
6月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13714 from taosdata/feature/stream
enh(tmq): add log
上级
4d1e3533
6f4f6c14
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
3 deletion
+23
-3
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+7
-0
source/dnode/mnode/impl/src/mndOffset.c
source/dnode/mnode/impl/src/mndOffset.c
+4
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+11
-1
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+1
-1
未找到文件。
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
91940ac7
...
...
@@ -447,6 +447,8 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
pConsumerOld
=
mndAcquireConsumer
(
pMnode
,
consumerId
);
if
(
pConsumerOld
==
NULL
)
{
mInfo
(
"receive subscribe request from new consumer: %ld"
,
consumerId
);
pConsumerNew
=
tNewSMqConsumerObj
(
consumerId
,
cgroup
);
tstrncpy
(
pConsumerNew
->
clientId
,
subscribe
.
clientId
,
256
);
pConsumerNew
->
updateType
=
CONSUMER_UPDATE__MODIFY
;
...
...
@@ -463,7 +465,12 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
}
else
{
/*taosRLockLatch(&pConsumerOld->lock);*/
int32_t
status
=
atomic_load_32
(
&
pConsumerOld
->
status
);
mInfo
(
"receive subscribe request from old consumer: %ld, current status: %s"
,
consumerId
,
mndConsumerStatusName
(
status
));
if
(
status
!=
MQ_CONSUMER_STATUS__READY
)
{
terrno
=
TSDB_CODE_MND_CONSUMER_NOT_READY
;
goto
SUBSCRIBE_OVER
;
...
...
source/dnode/mnode/impl/src/mndOffset.c
浏览文件 @
91940ac7
...
...
@@ -183,7 +183,10 @@ static int32_t mndProcessCommitOffsetReq(SRpcMsg *pMsg) {
for
(
int32_t
i
=
0
;
i
<
commitOffsetReq
.
num
;
i
++
)
{
SMqOffset
*
pOffset
=
&
commitOffsetReq
.
offsets
[
i
];
mInfo
(
"commit offset %ld to vg %d of consumer group %s on topic %s"
,
pOffset
->
offset
,
pOffset
->
vgId
,
pOffset
->
cgroup
,
pOffset
->
topicName
);
if
(
mndMakePartitionKey
(
key
,
pOffset
->
cgroup
,
pOffset
->
topicName
,
pOffset
->
vgId
)
<
0
)
{
mError
(
"submit offset to topic %s failed"
,
pOffset
->
topicName
);
return
-
1
;
}
bool
create
=
false
;
...
...
@@ -192,7 +195,7 @@ static int32_t mndProcessCommitOffsetReq(SRpcMsg *pMsg) {
SMqTopicObj
*
pTopic
=
mndAcquireTopic
(
pMnode
,
pOffset
->
topicName
);
if
(
pTopic
==
NULL
)
{
terrno
=
TSDB_CODE_MND_TOPIC_NOT_EXIST
;
mError
(
"submit offset to topic %s failed since
%s"
,
pOffset
->
topicName
,
terrstr
());
mError
(
"submit offset to topic %s failed since %s"
,
pOffset
->
topicName
,
terrstr
());
continue
;
}
pOffsetObj
=
taosMemoryMalloc
(
sizeof
(
SMqOffsetObj
));
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
91940ac7
...
...
@@ -130,7 +130,17 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
TD_VID
(
pTq
->
pVnode
),
pReq
->
currentOffset
,
fetchOffset
);
STqHandle
*
pHandle
=
taosHashGet
(
pTq
->
handles
,
pReq
->
subKey
,
strlen
(
pReq
->
subKey
));
ASSERT
(
pHandle
);
/*ASSERT(pHandle);*/
if
(
pHandle
==
NULL
)
{
tqError
(
"tmq poll: no consumer handle for consumer %ld in vg %d, subkey %s"
,
consumerId
,
pTq
->
pVnode
->
config
.
vgId
,
pReq
->
subKey
);
return
-
1
;
}
if
(
pHandle
->
consumerId
!=
consumerId
)
{
tqError
(
"tmq poll: consumer handle mismatch for consumer %ld in vg %d, subkey %s, handle consumer id %ld"
,
consumerId
,
pTq
->
pVnode
->
config
.
vgId
,
pReq
->
subKey
,
pHandle
->
consumerId
);
return
-
1
;
}
int32_t
consumerEpoch
=
atomic_load_32
(
&
pHandle
->
epoch
);
while
(
consumerEpoch
<
reqEpoch
)
{
...
...
tests/system-test/fulltest.sh
浏览文件 @
91940ac7
...
...
@@ -98,7 +98,7 @@ python3 ./test.py -f 2-query/statecount.py
python3 ./test.py
-f
7-tmq/basic5.py
python3 ./test.py
-f
7-tmq/subscribeDb.py
python3 ./test.py
-f
7-tmq/subscribeDb0.py
#
python3 ./test.py -f 7-tmq/subscribeDb1.py
python3 ./test.py
-f
7-tmq/subscribeDb1.py
python3 ./test.py
-f
7-tmq/subscribeStb.py
python3 ./test.py
-f
7-tmq/subscribeStb0.py
python3 ./test.py
-f
7-tmq/subscribeStb1.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录