Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5de46007
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5de46007
编写于
6月 15, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:remove lost_reb status
上级
a7a518aa
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
116 addition
and
102 deletion
+116
-102
include/common/tmsgdef.h
include/common/tmsgdef.h
+1
-1
source/dnode/mnode/impl/inc/mndConsumer.h
source/dnode/mnode/impl/inc/mndConsumer.h
+4
-4
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+1
-1
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+93
-94
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+17
-0
source/dnode/mnode/impl/src/mndTopic.c
source/dnode/mnode/impl/src/mndTopic.c
+0
-2
未找到文件。
include/common/tmsgdef.h
浏览文件 @
5de46007
...
...
@@ -145,7 +145,7 @@ enum {
TD_DEF_MSG_TYPE
(
TDMT_MND_TMQ_DROP_TOPIC
,
"drop-topic"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_TMQ_SUBSCRIBE
,
"subscribe"
,
SCMSubscribeReq
,
SCMSubscribeRsp
)
TD_DEF_MSG_TYPE
(
TDMT_MND_TMQ_ASK_EP
,
"ask-ep"
,
SMqAskEpReq
,
SMqAskEpRsp
)
TD_DEF_MSG_TYPE
(
TDMT_MND_TMQ_CONSUMER_LOST
,
"consumer-lost"
,
SMqConsumerLostMsg
,
NULL
)
//
TD_DEF_MSG_TYPE(TDMT_MND_TMQ_CONSUMER_LOST, "consumer-lost", SMqConsumerLostMsg, NULL)
TD_DEF_MSG_TYPE
(
TDMT_MND_TMQ_CONSUMER_RECOVER
,
"consumer-recover"
,
SMqConsumerRecoverMsg
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_TMQ_HB
,
"consumer-hb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_TMQ_DO_REBALANCE
,
"do-rebalance"
,
SMqDoRebalanceMsg
,
NULL
)
...
...
source/dnode/mnode/impl/inc/mndConsumer.h
浏览文件 @
5de46007
...
...
@@ -25,11 +25,11 @@ extern "C" {
enum
{
MQ_CONSUMER_STATUS_REBALANCE
=
1
,
// MQ_CONSUMER_STATUS__MODIFY_IN_REB, // this value is not used anymore
MQ_CONSUMER_STATUS_
_
READY
,
MQ_CONSUMER_STATUS_
_
LOST
,
MQ_CONSUMER_STATUS_READY
,
MQ_CONSUMER_STATUS_LOST
,
// MQ_CONSUMER_STATUS__LOST_IN_REB, // this value is not used anymore
MQ_CONSUMER_STATUS__LOST_REBD
,
};
//
MQ_CONSUMER_STATUS__LOST_REBD,
};
\
int32_t
mndInitConsumer
(
SMnode
*
pMnode
);
void
mndCleanupConsumer
(
SMnode
*
pMnode
);
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
5de46007
...
...
@@ -140,7 +140,7 @@ typedef enum {
CONSUMER_UPDATE_REB_MODIFY_NOTOPIC
=
1
,
// topic do not need modified after rebalance
CONSUMER_UPDATE_REB_MODIFY_TOPIC
,
// topic need modified after rebalance
CONSUMER_UPDATE_REB_MODIFY_REMOVE
,
// topic need removed after rebalance
CONSUMER_UPDATE_TIMER_LOST
,
//
CONSUMER_UPDATE_TIMER_LOST,
CONSUMER_UPDATE_RECOVER
,
CONSUMER_UPDATE_SUB_MODIFY
,
// modify after subscribe req
}
ECsmUpdateType
;
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
5de46007
...
...
@@ -63,7 +63,7 @@ int32_t mndInitConsumer(SMnode *pMnode) {
mndSetMsgHandle
(
pMnode
,
TDMT_MND_TMQ_HB
,
mndProcessMqHbReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_TMQ_ASK_EP
,
mndProcessAskEpReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_TMQ_TIMER
,
mndProcessMqTimerMsg
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_TMQ_CONSUMER_LOST
,
mndProcessConsumerLostMsg
);
//
mndSetMsgHandle(pMnode, TDMT_MND_TMQ_CONSUMER_LOST, mndProcessConsumerLostMsg);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_TMQ_CONSUMER_RECOVER
,
mndProcessConsumerRecoverMsg
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_TMQ_LOST_CONSUMER_CLEAR
,
mndProcessConsumerClearMsg
);
...
...
@@ -105,48 +105,48 @@ void mndRebCntDec() {
}
}
static
int32_t
mndProcessConsumerLostMsg
(
SRpcMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
SMqConsumerLostMsg
*
pLostMsg
=
pMsg
->
pCont
;
SMqConsumerObj
*
pConsumer
=
mndAcquireConsumer
(
pMnode
,
pLostMsg
->
consumerId
);
if
(
pConsumer
==
NULL
)
{
return
0
;
}
mInfo
(
"process consumer lost msg, consumer:0x%"
PRIx64
" status:%d(%s)"
,
pLostMsg
->
consumerId
,
pConsumer
->
status
,
mndConsumerStatusName
(
pConsumer
->
status
));
if
(
pConsumer
->
status
!=
MQ_CONSUMER_STATUS_
_READY
)
{
mndReleaseConsumer
(
pMnode
,
pConsumer
);
return
-
1
;
}
SMqConsumerObj
*
pConsumerNew
=
tNewSMqConsumerObj
(
pConsumer
->
consumerId
,
pConsumer
->
cgroup
);
pConsumerNew
->
updateType
=
CONSUMER_UPDATE_TIMER_LOST
;
mndReleaseConsumer
(
pMnode
,
pConsumer
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_NOTHING
,
pMsg
,
"lost-csm"
);
if
(
pTrans
==
NULL
)
{
goto
FAIL
;
}
if
(
mndSetConsumerCommitLogs
(
pMnode
,
pTrans
,
pConsumerNew
)
!=
0
)
{
goto
FAIL
;
}
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
{
goto
FAIL
;
}
tDeleteSMqConsumerObj
(
pConsumerNew
,
true
);
mndTransDrop
(
pTrans
);
return
0
;
FAIL:
tDeleteSMqConsumerObj
(
pConsumerNew
,
true
);
mndTransDrop
(
pTrans
);
return
-
1
;
}
//
static int32_t mndProcessConsumerLostMsg(SRpcMsg *pMsg) {
//
SMnode *pMnode = pMsg->info.node;
//
SMqConsumerLostMsg *pLostMsg = pMsg->pCont;
//
SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, pLostMsg->consumerId);
//
if (pConsumer == NULL) {
//
return 0;
//
}
//
//
mInfo("process consumer lost msg, consumer:0x%" PRIx64 " status:%d(%s)", pLostMsg->consumerId, pConsumer->status,
//
mndConsumerStatusName(pConsumer->status));
//
// if (pConsumer->status != MQ_CONSUMER_STATUS
_READY) {
//
mndReleaseConsumer(pMnode, pConsumer);
//
return -1;
//
}
//
//
SMqConsumerObj *pConsumerNew = tNewSMqConsumerObj(pConsumer->consumerId, pConsumer->cgroup);
//
pConsumerNew->updateType = CONSUMER_UPDATE_TIMER_LOST;
//
//
mndReleaseConsumer(pMnode, pConsumer);
//
//
STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, pMsg, "lost-csm");
//
if (pTrans == NULL) {
//
goto FAIL;
//
}
//
//
if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) {
//
goto FAIL;
//
}
//
//
if (mndTransPrepare(pMnode, pTrans) != 0) {
//
goto FAIL;
//
}
//
//
tDeleteSMqConsumerObj(pConsumerNew, true);
//
mndTransDrop(pTrans);
//
return 0;
//
FAIL:
//
tDeleteSMqConsumerObj(pConsumerNew, true);
//
mndTransDrop(pTrans);
//
return -1;
//
}
static
int32_t
mndProcessConsumerRecoverMsg
(
SRpcMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
...
...
@@ -160,7 +160,7 @@ static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) {
mInfo
(
"receive consumer recover msg, consumer:0x%"
PRIx64
" status:%d(%s)"
,
pRecoverMsg
->
consumerId
,
pConsumer
->
status
,
mndConsumerStatusName
(
pConsumer
->
status
));
if
(
pConsumer
->
status
!=
MQ_CONSUMER_STATUS_
_
LOST
)
{
if
(
pConsumer
->
status
!=
MQ_CONSUMER_STATUS_LOST
)
{
mndReleaseConsumer
(
pMnode
,
pConsumer
);
terrno
=
TSDB_CODE_MND_CONSUMER_NOT_READY
;
return
-
1
;
...
...
@@ -204,7 +204,7 @@ static int32_t mndProcessConsumerClearMsg(SRpcMsg *pMsg) {
mInfo
(
"consumer:0x%"
PRIx64
" needs to be cleared, status %s"
,
pClearMsg
->
consumerId
,
mndConsumerStatusName
(
pConsumer
->
status
));
if
(
pConsumer
->
status
!=
MQ_CONSUMER_STATUS_
_LOST_REBD
)
{
if
(
pConsumer
->
status
!=
MQ_CONSUMER_STATUS_
LOST
)
{
mndReleaseConsumer
(
pMnode
,
pConsumer
);
return
-
1
;
}
...
...
@@ -299,26 +299,37 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) {
pConsumer
->
consumerId
,
status
,
mndConsumerStatusName
(
status
),
pConsumer
->
subscribeTime
,
pConsumer
->
createTime
,
hbStatus
);
if
(
status
==
MQ_CONSUMER_STATUS_
_
READY
)
{
if
(
status
==
MQ_CONSUMER_STATUS_READY
)
{
if
(
hbStatus
>
MND_CONSUMER_LOST_HB_CNT
)
{
SMqConsumerLostMsg
*
pLostMsg
=
rpcMallocCont
(
sizeof
(
SMqConsumerLostMsg
));
if
(
pLostMsg
==
NULL
)
{
mError
(
"consumer:0x%"
PRIx64
" failed to transfer consumer status to lost due to out of memory. alloc size:%d"
,
pConsumer
->
consumerId
,
(
int32_t
)
sizeof
(
SMqConsumerLostMsg
));
continue
;
// SMqConsumerLostMsg *pLostMsg = rpcMallocCont(sizeof(SMqConsumerLostMsg));
// if (pLostMsg == NULL) {
// mError("consumer:0x%"PRIx64" failed to transfer consumer status to lost due to out of memory. alloc size:%d",
// pConsumer->consumerId, (int32_t)sizeof(SMqConsumerLostMsg));
// continue;
// }
//
// pLostMsg->consumerId = pConsumer->consumerId;
// SRpcMsg rpcMsg = {
// .msgType = TDMT_MND_TMQ_CONSUMER_LOST, .pCont = pLostMsg, .contLen = sizeof(SMqConsumerLostMsg)};
//
// mDebug("consumer:0x%"PRIx64" hb not received beyond threshold %d, set to lost", pConsumer->consumerId,
// MND_CONSUMER_LOST_HB_CNT);
// tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg);
taosRLockLatch
(
&
pConsumer
->
lock
);
int32_t
topicNum
=
taosArrayGetSize
(
pConsumer
->
currentTopics
);
for
(
int32_t
i
=
0
;
i
<
topicNum
;
i
++
)
{
char
key
[
TSDB_SUBSCRIBE_KEY_LEN
];
char
*
removedTopic
=
taosArrayGetP
(
pConsumer
->
currentTopics
,
i
);
mndMakeSubscribeKey
(
key
,
pConsumer
->
cgroup
,
removedTopic
);
SMqRebInfo
*
pRebSub
=
mndGetOrCreateRebSub
(
pRebMsg
->
rebSubHash
,
key
);
taosArrayPush
(
pRebSub
->
removedConsumers
,
&
pConsumer
->
consumerId
);
}
pLostMsg
->
consumerId
=
pConsumer
->
consumerId
;
SRpcMsg
rpcMsg
=
{
.
msgType
=
TDMT_MND_TMQ_CONSUMER_LOST
,
.
pCont
=
pLostMsg
,
.
contLen
=
sizeof
(
SMqConsumerLostMsg
)};
mDebug
(
"consumer:0x%"
PRIx64
" hb not received beyond threshold %d, set to lost"
,
pConsumer
->
consumerId
,
MND_CONSUMER_LOST_HB_CNT
);
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
WRITE_QUEUE
,
&
rpcMsg
);
taosRUnLockLatch
(
&
pConsumer
->
lock
);
}
}
else
if
(
status
==
MQ_CONSUMER_STATUS_
_LOST_REBD
)
{
}
else
if
(
status
==
MQ_CONSUMER_STATUS_
LOST
)
{
// if the client is lost longer than one day, clear it. Otherwise, do nothing about the lost consumers.
if
(
hbStatus
>
MND_CONSUMER_LOST_CLEAR_THRESHOLD
)
{
if
(
hbStatus
>
MND_CONSUMER_LOST_CLEAR_THRESHOLD
||
taosArrayGetSize
(
pConsumer
->
assignedTopics
)
==
0
)
{
// clear consumer if lost a day or unsubscribe/close
SMqConsumerClearMsg
*
pClearMsg
=
rpcMallocCont
(
sizeof
(
SMqConsumerClearMsg
));
if
(
pClearMsg
==
NULL
)
{
mError
(
"consumer:0x%"
PRIx64
" failed to clear consumer due to out of memory. alloc size:%d"
,
...
...
@@ -334,17 +345,6 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) {
MND_CONSUMER_LOST_CLEAR_THRESHOLD
);
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
WRITE_QUEUE
,
&
rpcMsg
);
}
}
else
if
(
status
==
MQ_CONSUMER_STATUS__LOST
)
{
taosRLockLatch
(
&
pConsumer
->
lock
);
int32_t
topicNum
=
taosArrayGetSize
(
pConsumer
->
currentTopics
);
for
(
int32_t
i
=
0
;
i
<
topicNum
;
i
++
)
{
char
key
[
TSDB_SUBSCRIBE_KEY_LEN
];
char
*
removedTopic
=
taosArrayGetP
(
pConsumer
->
currentTopics
,
i
);
mndMakeSubscribeKey
(
key
,
pConsumer
->
cgroup
,
removedTopic
);
SMqRebInfo
*
pRebSub
=
mndGetOrCreateRebSub
(
pRebMsg
->
rebSubHash
,
key
);
taosArrayPush
(
pRebSub
->
removedConsumers
,
&
pConsumer
->
consumerId
);
}
taosRUnLockLatch
(
&
pConsumer
->
lock
);
}
else
{
// MQ_CONSUMER_STATUS_REBALANCE
taosRLockLatch
(
&
pConsumer
->
lock
);
...
...
@@ -409,7 +409,7 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
int32_t
status
=
atomic_load_32
(
&
pConsumer
->
status
);
if
(
status
==
MQ_CONSUMER_STATUS_
_
LOST
)
{
if
(
status
==
MQ_CONSUMER_STATUS_LOST
)
{
mInfo
(
"try to recover consumer:0x%"
PRIx64
""
,
consumerId
);
SMqConsumerRecoverMsg
*
pRecoverMsg
=
rpcMallocCont
(
sizeof
(
SMqConsumerRecoverMsg
));
...
...
@@ -460,7 +460,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
// 1. check consumer status
int32_t
status
=
atomic_load_32
(
&
pConsumer
->
status
);
if
(
status
==
MQ_CONSUMER_STATUS_
_
LOST
)
{
if
(
status
==
MQ_CONSUMER_STATUS_LOST
)
{
mInfo
(
"try to recover consumer:0x%"
PRIx64
,
consumerId
);
SMqConsumerRecoverMsg
*
pRecoverMsg
=
rpcMallocCont
(
sizeof
(
SMqConsumerRecoverMsg
));
...
...
@@ -474,7 +474,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
WRITE_QUEUE
,
&
pRpcMsg
);
}
if
(
status
!=
MQ_CONSUMER_STATUS_
_
READY
)
{
if
(
status
!=
MQ_CONSUMER_STATUS_READY
)
{
mInfo
(
"consumer:0x%"
PRIx64
" not ready, status: %s"
,
consumerId
,
mndConsumerStatusName
(
status
));
terrno
=
TSDB_CODE_MND_CONSUMER_NOT_READY
;
return
-
1
;
...
...
@@ -692,7 +692,7 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
" cgroup:%s, current status:%d(%s), subscribe topic num: %d"
,
consumerId
,
subscribe
.
cgroup
,
status
,
mndConsumerStatusName
(
status
),
newTopicNum
);
if
(
status
!=
MQ_CONSUMER_STATUS_
_
READY
)
{
if
(
status
!=
MQ_CONSUMER_STATUS_READY
)
{
terrno
=
TSDB_CODE_MND_CONSUMER_NOT_READY
;
goto
_over
;
}
...
...
@@ -881,9 +881,9 @@ static void updateConsumerStatus(SMqConsumerObj *pConsumer) {
if
(
taosArrayGetSize
(
pConsumer
->
rebNewTopics
)
==
0
&&
taosArrayGetSize
(
pConsumer
->
rebRemovedTopics
)
==
0
)
{
if
(
status
==
MQ_CONSUMER_STATUS_REBALANCE
)
{
pConsumer
->
status
=
MQ_CONSUMER_STATUS_
_
READY
;
}
else
if
(
status
==
MQ_CONSUMER_STATUS_
_LOST
)
{
pConsumer
->
status
=
MQ_CONSUMER_STATUS_
_LOST_REBD
;
pConsumer
->
status
=
MQ_CONSUMER_STATUS_READY
;
}
else
if
(
status
==
MQ_CONSUMER_STATUS_
READY
)
{
pConsumer
->
status
=
MQ_CONSUMER_STATUS_
LOST
;
}
}
}
...
...
@@ -964,18 +964,18 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
pOldConsumer
->
subscribeTime
=
taosGetTimestampMs
();
pOldConsumer
->
status
=
MQ_CONSUMER_STATUS_REBALANCE
;
mInfo
(
"consumer:0x%"
PRIx64
" sub update, modify existed consumer"
,
pOldConsumer
->
consumerId
);
}
else
if
(
pNewConsumer
->
updateType
==
CONSUMER_UPDATE_TIMER_LOST
)
{
int32_t
sz
=
taosArrayGetSize
(
pOldConsumer
->
currentTopics
);
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
char
*
topic
=
taosStrdup
(
taosArrayGetP
(
pOldConsumer
->
currentTopics
,
i
));
taosArrayPush
(
pOldConsumer
->
rebRemovedTopics
,
&
topic
);
}
int32_t
prevStatus
=
pOldConsumer
->
status
;
pOldConsumer
->
status
=
MQ_CONSUMER_STATUS_
_LOST
;
mInfo
(
"consumer:0x%"
PRIx64
" timer update, timer lost. state %s -> %s, reb-time:%"
PRId64
", reb-removed-topics:%d"
,
pOldConsumer
->
consumerId
,
mndConsumerStatusName
(
prevStatus
),
mndConsumerStatusName
(
pOldConsumer
->
status
),
pOldConsumer
->
rebalanceTime
,
(
int
)
taosArrayGetSize
(
pOldConsumer
->
rebRemovedTopics
));
//
} else if (pNewConsumer->updateType == CONSUMER_UPDATE_TIMER_LOST) {
//
int32_t sz = taosArrayGetSize(pOldConsumer->currentTopics);
//
for (int32_t i = 0; i < sz; i++) {
//
char *topic = taosStrdup(taosArrayGetP(pOldConsumer->currentTopics, i));
//
taosArrayPush(pOldConsumer->rebRemovedTopics, &topic);
//
}
//
//
int32_t prevStatus = pOldConsumer->status;
// pOldConsumer->status = MQ_CONSUMER_STATUS
_LOST;
//
mInfo("consumer:0x%" PRIx64 " timer update, timer lost. state %s -> %s, reb-time:%" PRId64 ", reb-removed-topics:%d",
//
pOldConsumer->consumerId, mndConsumerStatusName(prevStatus), mndConsumerStatusName(pOldConsumer->status),
//
pOldConsumer->rebalanceTime, (int)taosArrayGetSize(pOldConsumer->rebRemovedTopics));
}
else
if
(
pNewConsumer
->
updateType
==
CONSUMER_UPDATE_RECOVER
)
{
int32_t
sz
=
taosArrayGetSize
(
pOldConsumer
->
assignedTopics
);
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
...
...
@@ -1176,10 +1176,9 @@ static void mndCancelGetNextConsumer(SMnode *pMnode, void *pIter) {
static
const
char
*
mndConsumerStatusName
(
int
status
)
{
switch
(
status
)
{
case
MQ_CONSUMER_STATUS_
_
READY
:
case
MQ_CONSUMER_STATUS_READY
:
return
"ready"
;
case
MQ_CONSUMER_STATUS__LOST
:
case
MQ_CONSUMER_STATUS__LOST_REBD
:
case
MQ_CONSUMER_STATUS_LOST
:
return
"lost"
;
case
MQ_CONSUMER_STATUS_REBALANCE
:
return
"rebalancing"
;
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
5de46007
...
...
@@ -724,6 +724,23 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) {
return
-
1
;
}
void
*
pIter
=
NULL
;
SMqConsumerObj
*
pConsumer
;
while
(
1
)
{
pIter
=
sdbFetch
(
pMnode
->
pSdb
,
SDB_CONSUMER
,
pIter
,
(
void
**
)
&
pConsumer
);
if
(
pIter
==
NULL
)
{
break
;
}
if
(
strcmp
(
dropReq
.
cgroup
,
pConsumer
->
cgroup
)
==
0
)
{
sdbRelease
(
pMnode
->
pSdb
,
pConsumer
);
terrno
=
TSDB_CODE_MND_CGROUP_USED
;
mError
(
"cgroup:%s on topic:%s, failed to drop since %s"
,
dropReq
.
cgroup
,
dropReq
.
topic
,
terrstr
());
return
-
1
;
}
sdbRelease
(
pMnode
->
pSdb
,
pConsumer
);
}
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_NOTHING
,
pMsg
,
"drop-cgroup"
);
if
(
pTrans
==
NULL
)
{
mError
(
"cgroup: %s on topic:%s, failed to drop since %s"
,
dropReq
.
cgroup
,
dropReq
.
topic
,
terrstr
());
...
...
source/dnode/mnode/impl/src/mndTopic.c
浏览文件 @
5de46007
...
...
@@ -697,8 +697,6 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
break
;
}
if
(
pConsumer
->
status
==
MQ_CONSUMER_STATUS__LOST_REBD
)
continue
;
int32_t
sz
=
taosArrayGetSize
(
pConsumer
->
assignedTopics
);
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
char
*
name
=
taosArrayGetP
(
pConsumer
->
assignedTopics
,
i
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录