Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0262af7e
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
未验证
提交
0262af7e
编写于
2月 16, 2022
作者:
L
Liu Jicong
提交者:
GitHub
2月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10286 from taosdata/feature/tq
add eager rebalance back
上级
5e0a6d96
9cb9cb68
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
4 deletion
+6
-4
source/client/src/tmq.c
source/client/src/tmq.c
+2
-0
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+4
-4
未找到文件。
source/client/src/tmq.c
浏览文件 @
0262af7e
...
@@ -695,11 +695,13 @@ tmq_message_t* tmq_consumer_poll(tmq_t* tmq, int64_t blocking_time) {
...
@@ -695,11 +695,13 @@ tmq_message_t* tmq_consumer_poll(tmq_t* tmq, int64_t blocking_time) {
if
(
taosArrayGetSize
(
tmq
->
clientTopics
)
==
0
)
{
if
(
taosArrayGetSize
(
tmq
->
clientTopics
)
==
0
)
{
tscDebug
(
"consumer:%ld poll but not assigned"
,
tmq
->
consumerId
);
tscDebug
(
"consumer:%ld poll but not assigned"
,
tmq
->
consumerId
);
printf
(
"over1
\n
"
);
usleep
(
blocking_time
*
1000
);
usleep
(
blocking_time
*
1000
);
return
NULL
;
return
NULL
;
}
}
SMqClientTopic
*
pTopic
=
taosArrayGet
(
tmq
->
clientTopics
,
tmq
->
nextTopicIdx
);
SMqClientTopic
*
pTopic
=
taosArrayGet
(
tmq
->
clientTopics
,
tmq
->
nextTopicIdx
);
if
(
taosArrayGetSize
(
pTopic
->
vgs
)
==
0
)
{
if
(
taosArrayGetSize
(
pTopic
->
vgs
)
==
0
)
{
printf
(
"over2
\n
"
);
usleep
(
blocking_time
*
1000
);
usleep
(
blocking_time
*
1000
);
return
NULL
;
return
NULL
;
}
}
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
0262af7e
...
@@ -424,7 +424,9 @@ static int32_t mndProcessDoRebalanceMsg(SMnodeMsg *pMsg) {
...
@@ -424,7 +424,9 @@ static int32_t mndProcessDoRebalanceMsg(SMnodeMsg *pMsg) {
if
(
vgThisConsumerAfterRb
!=
vgThisConsumerBeforeRb
||
if
(
vgThisConsumerAfterRb
!=
vgThisConsumerBeforeRb
||
(
vgThisConsumerAfterRb
!=
0
&&
status
!=
MQ_CONSUMER_STATUS__ACTIVE
)
||
(
vgThisConsumerAfterRb
!=
0
&&
status
!=
MQ_CONSUMER_STATUS__ACTIVE
)
||
(
vgThisConsumerAfterRb
==
0
&&
status
!=
MQ_CONSUMER_STATUS__LOST
))
{
(
vgThisConsumerAfterRb
==
0
&&
status
!=
MQ_CONSUMER_STATUS__LOST
))
{
pRebConsumer
->
epoch
++
;
if
(
vgThisConsumerAfterRb
!=
vgThisConsumerBeforeRb
)
{
pRebConsumer
->
epoch
++
;
}
if
(
vgThisConsumerAfterRb
!=
0
)
{
if
(
vgThisConsumerAfterRb
!=
0
)
{
atomic_store_32
(
&
pRebConsumer
->
status
,
MQ_CONSUMER_STATUS__ACTIVE
);
atomic_store_32
(
&
pRebConsumer
->
status
,
MQ_CONSUMER_STATUS__ACTIVE
);
}
else
{
}
else
{
...
@@ -1036,7 +1038,6 @@ static int32_t mndProcessSubscribeReq(SMnodeMsg *pMsg) {
...
@@ -1036,7 +1038,6 @@ static int32_t mndProcessSubscribeReq(SMnodeMsg *pMsg) {
taosArrayPush
(
pSub
->
consumers
,
&
mqSubConsumer
);
taosArrayPush
(
pSub
->
consumers
,
&
mqSubConsumer
);
// if have un assigned vg, assign one to the consumer
// if have un assigned vg, assign one to the consumer
#if 0
if
(
taosArrayGetSize
(
pSub
->
unassignedVg
)
>
0
)
{
if
(
taosArrayGetSize
(
pSub
->
unassignedVg
)
>
0
)
{
SMqConsumerEp
*
pConsumerEp
=
taosArrayPop
(
pSub
->
unassignedVg
);
SMqConsumerEp
*
pConsumerEp
=
taosArrayPop
(
pSub
->
unassignedVg
);
pConsumerEp
->
oldConsumerId
=
pConsumerEp
->
consumerId
;
pConsumerEp
->
oldConsumerId
=
pConsumerEp
->
consumerId
;
...
@@ -1047,10 +1048,9 @@ static int32_t mndProcessSubscribeReq(SMnodeMsg *pMsg) {
...
@@ -1047,10 +1048,9 @@ static int32_t mndProcessSubscribeReq(SMnodeMsg *pMsg) {
}
else
{
}
else
{
mndPersistRebalanceMsg
(
pMnode
,
pTrans
,
pConsumerEp
);
mndPersistRebalanceMsg
(
pMnode
,
pTrans
,
pConsumerEp
);
}
}
//
do not set status active to trigger rebalanc
e
//
to trigger rebalance at once, do not set status activ
e
/*atomic_store_32(&pConsumer->status, MQ_CONSUMER_STATUS__ACTIVE);*/
/*atomic_store_32(&pConsumer->status, MQ_CONSUMER_STATUS__ACTIVE);*/
}
}
#endif
SSdbRaw
*
pRaw
=
mndSubActionEncode
(
pSub
);
SSdbRaw
*
pRaw
=
mndSubActionEncode
(
pSub
);
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录