Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c8694874
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看板
未验证
提交
c8694874
编写于
5月 31, 2022
作者:
L
Liu Jicong
提交者:
GitHub
5月 31, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13324 from taosdata/feature/tq
feat(tmq): support drop cgroup
上级
d8545783
77757f3e
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
14 addition
and
6 deletion
+14
-6
include/common/tmsgdef.h
include/common/tmsgdef.h
+0
-1
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+2
-0
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+10
-3
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+1
-1
source/util/src/terror.c
source/util/src/terror.c
+1
-1
未找到文件。
include/common/tmsgdef.h
浏览文件 @
c8694874
...
...
@@ -144,7 +144,6 @@ enum {
TD_DEF_MSG_TYPE
(
TDMT_MND_CREATE_TOPIC
,
"mnode-create-topic"
,
SMCreateTopicReq
,
SMCreateTopicRsp
)
TD_DEF_MSG_TYPE
(
TDMT_MND_ALTER_TOPIC
,
"mnode-alter-topic"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_DROP_TOPIC
,
"mnode-drop-topic"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_DROP_CGROUP
,
"mnode-drop-cgroup"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_SUBSCRIBE
,
"mnode-subscribe"
,
SCMSubscribeReq
,
SCMSubscribeRsp
)
TD_DEF_MSG_TYPE
(
TDMT_MND_MQ_ASK_EP
,
"mnode-mq-ask-ep"
,
SMqAskEpReq
,
SMqAskEpRsp
)
TD_DEF_MSG_TYPE
(
TDMT_MND_MQ_TIMER
,
"mnode-mq-tmr"
,
SMTimerReq
,
NULL
)
...
...
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
浏览文件 @
c8694874
...
...
@@ -197,6 +197,8 @@ SArray *mmGetMsgHandles() {
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_SUBSCRIBE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_MQ_COMMIT_OFFSET
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_MQ_ASK_EP
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_MQ_DROP_CGROUP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_MQ_DROP_CGROUP_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_MQ_VG_CHANGE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_MQ_VG_DELETE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_STREAM
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
c8694874
...
...
@@ -78,6 +78,7 @@ int32_t mndInitSubscribe(SMnode *pMnode) {
mndSetMsgHandle
(
pMnode
,
TDMT_MND_MQ_DO_REBALANCE
,
mndProcessRebalanceReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_MQ_DO_REBALANCE
,
mndProcessRebalanceReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_MQ_DROP_CGROUP
,
mndProcessDropCgroupReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_MQ_DROP_CGROUP_RSP
,
mndProcessSubscribeInternalRsp
);
mndAddShowRetrieveHandle
(
pMnode
,
TSDB_MGMT_TABLE_SUBSCRIPTIONS
,
mndRetrieveSubscribe
);
mndAddShowFreeIterHandle
(
pMnode
,
TSDB_MGMT_TABLE_TOPICS
,
mndCancelGetNextSubscribe
);
...
...
@@ -597,7 +598,7 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
static
int32_t
mndProcessDropCgroupReq
(
SRpcMsg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
info
.
node
;
/*SSdb *pSdb = pMnode->pSdb;*/
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SMDropCgroupReq
dropReq
=
{
0
};
if
(
tDeserializeSMDropCgroupReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
...
...
@@ -617,15 +618,17 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pReq) {
}
}
if
(
taosHashGetSize
(
pSub
->
consumerHash
)
=
=
0
)
{
if
(
taosHashGetSize
(
pSub
->
consumerHash
)
!
=
0
)
{
terrno
=
TSDB_CODE_MND_CGROUP_USED
;
mError
(
"cgroup:%s on topic:%s, failed to drop since %s"
,
dropReq
.
cgroup
,
dropReq
.
topic
,
terrstr
());
mndReleaseSubscribe
(
pMnode
,
pSub
);
return
-
1
;
}
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_DROP_CGROUP
,
pReq
);
if
(
pTrans
==
NULL
)
{
mError
(
"cgroup: %s on topic:%s, failed to drop since %s"
,
dropReq
.
cgroup
,
dropReq
.
topic
,
terrstr
());
mndReleaseSubscribe
(
pMnode
,
pSub
);
return
-
1
;
}
...
...
@@ -633,14 +636,18 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pReq) {
if
(
mndDropOffsetBySubKey
(
pMnode
,
pTrans
,
pSub
->
key
)
<
0
)
{
ASSERT
(
0
);
mndReleaseSubscribe
(
pMnode
,
pSub
);
return
-
1
;
}
if
(
mndSetDropSubCommitLogs
(
pMnode
,
pTrans
,
pSub
)
<
0
)
{
mError
(
"cgroup %s on topic:%s, failed to drop since %s"
,
dropReq
.
cgroup
,
dropReq
.
topic
,
terrstr
());
mndReleaseSubscribe
(
pMnode
,
pSub
);
return
-
1
;
}
mndTransPrepare
(
pMnode
,
pTrans
);
mndReleaseSubscribe
(
pMnode
,
pSub
);
return
TSDB_CODE_ACTION_IN_PROGRESS
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
c8694874
...
...
@@ -3381,7 +3381,7 @@ static int32_t translateDropCGroup(STranslateContext* pCxt, SDropCGroupStmt* pSt
dropReq
.
igNotExists
=
pStmt
->
ignoreNotExists
;
strcpy
(
dropReq
.
cgroup
,
pStmt
->
cgroup
);
return
buildCmdMsg
(
pCxt
,
TDMT_MND_DROP_CGROUP
,
(
FSerializeFunc
)
tSerializeSMDropCgroupReq
,
&
dropReq
);
return
buildCmdMsg
(
pCxt
,
TDMT_MND_
MQ_
DROP_CGROUP
,
(
FSerializeFunc
)
tSerializeSMDropCgroupReq
,
&
dropReq
);
}
static
int32_t
translateAlterLocal
(
STranslateContext
*
pCxt
,
SAlterLocalStmt
*
pStmt
)
{
...
...
source/util/src/terror.c
浏览文件 @
c8694874
...
...
@@ -270,7 +270,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_TOPIC, "Invalid topic")
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TOPIC_QUERY
,
"Topic with invalid query"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TOPIC_OPTION
,
"Topic with invalid option"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_CONSUMER_NOT_EXIST
,
"Consumer not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_C
ONSUMER_NOT_READY
,
"Consumer waiting for rebalance
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_C
GROUP_USED
,
"Consumer group being used by some consumer
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOPIC_SUBSCRIBED
,
"Topic subscribed cannot be dropped"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_STREAM_ALREADY_EXIST
,
"Stream already exists"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录