Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bb1e24dd
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看板
提交
bb1e24dd
编写于
6月 29, 2023
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/main' into fix/m23.0
上级
edf5b8c9
230dc183
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
10 deletion
+31
-10
source/common/src/systable.c
source/common/src/systable.c
+2
-2
source/dnode/mnode/impl/inc/mndSubscribe.h
source/dnode/mnode/impl/inc/mndSubscribe.h
+1
-0
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+2
-8
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+26
-0
未找到文件。
source/common/src/systable.c
浏览文件 @
bb1e24dd
...
@@ -160,9 +160,9 @@ static const SSysDbTableSchema streamSchema[] = {
...
@@ -160,9 +160,9 @@ static const SSysDbTableSchema streamSchema[] = {
static
const
SSysDbTableSchema
streamTaskSchema
[]
=
{
static
const
SSysDbTableSchema
streamTaskSchema
[]
=
{
{.
name
=
"stream_name"
,
.
bytes
=
SYSTABLE_SCH_DB_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"stream_name"
,
.
bytes
=
SYSTABLE_SCH_DB_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"task_id"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
false
},
{.
name
=
"task_id"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
false
},
{.
name
=
"node_type"
,
.
bytes
=
SYSTABLE_SCH_DB_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"node_type"
,
.
bytes
=
SYSTABLE_SCH_DB_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"node_id"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
false
},
{.
name
=
"node_id"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
false
},
{.
name
=
"level"
,
.
bytes
=
20
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"level"
,
.
bytes
=
20
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"status"
,
.
bytes
=
20
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
{.
name
=
"status"
,
.
bytes
=
20
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
false
},
};
};
...
...
source/dnode/mnode/impl/inc/mndSubscribe.h
浏览文件 @
bb1e24dd
...
@@ -25,6 +25,7 @@ extern "C" {
...
@@ -25,6 +25,7 @@ extern "C" {
int32_t
mndInitSubscribe
(
SMnode
*
pMnode
);
int32_t
mndInitSubscribe
(
SMnode
*
pMnode
);
void
mndCleanupSubscribe
(
SMnode
*
pMnode
);
void
mndCleanupSubscribe
(
SMnode
*
pMnode
);
int32_t
mndGetGroupNumByTopic
(
SMnode
*
pMnode
,
const
char
*
topicName
);
SMqSubscribeObj
*
mndAcquireSubscribe
(
SMnode
*
pMnode
,
const
char
*
CGroup
,
const
char
*
topicName
);
SMqSubscribeObj
*
mndAcquireSubscribe
(
SMnode
*
pMnode
,
const
char
*
CGroup
,
const
char
*
topicName
);
SMqSubscribeObj
*
mndAcquireSubscribeByKey
(
SMnode
*
pMnode
,
const
char
*
key
);
SMqSubscribeObj
*
mndAcquireSubscribeByKey
(
SMnode
*
pMnode
,
const
char
*
key
);
void
mndReleaseSubscribe
(
SMnode
*
pMnode
,
SMqSubscribeObj
*
pSub
);
void
mndReleaseSubscribe
(
SMnode
*
pMnode
,
SMqSubscribeObj
*
pSub
);
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
bb1e24dd
...
@@ -666,18 +666,12 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
...
@@ -666,18 +666,12 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
int32_t
newTopicNum
=
taosArrayGetSize
(
pTopicList
);
int32_t
newTopicNum
=
taosArrayGetSize
(
pTopicList
);
for
(
int
i
=
0
;
i
<
newTopicNum
;
i
++
){
for
(
int
i
=
0
;
i
<
newTopicNum
;
i
++
){
SMqSubscribeObj
*
pSub
=
mndAcquireSubscribe
(
pMnode
,
(
const
char
*
)
cgroup
,
(
const
char
*
)
taosArrayGetP
(
pTopicList
,
i
));
int32_t
gNum
=
mndGetGroupNumByTopic
(
pMnode
,
(
const
char
*
)
taosArrayGetP
(
pTopicList
,
i
));
if
(
pSub
==
NULL
)
continue
;
if
(
gNum
>=
MND_MAX_GROUP_PER_TOPIC
){
taosRLockLatch
(
&
pSub
->
lock
);
if
(
taosHashGetSize
(
pSub
->
consumerHash
)
>
MND_MAX_GROUP_PER_TOPIC
){
terrno
=
TSDB_CODE_TMQ_GROUP_OUT_OF_RANGE
;
terrno
=
TSDB_CODE_TMQ_GROUP_OUT_OF_RANGE
;
code
=
terrno
;
code
=
terrno
;
taosRUnLockLatch
(
&
pSub
->
lock
);
mndReleaseSubscribe
(
pMnode
,
pSub
);
goto
_over
;
goto
_over
;
}
}
taosRUnLockLatch
(
&
pSub
->
lock
);
mndReleaseSubscribe
(
pMnode
,
pSub
);
}
}
// check topic existence
// check topic existence
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
bb1e24dd
...
@@ -992,6 +992,32 @@ SMqSubscribeObj *mndAcquireSubscribeByKey(SMnode *pMnode, const char *key) {
...
@@ -992,6 +992,32 @@ SMqSubscribeObj *mndAcquireSubscribeByKey(SMnode *pMnode, const char *key) {
return
pSub
;
return
pSub
;
}
}
int32_t
mndGetGroupNumByTopic
(
SMnode
*
pMnode
,
const
char
*
topicName
)
{
int32_t
num
=
0
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
void
*
pIter
=
NULL
;
SMqSubscribeObj
*
pSub
=
NULL
;
while
(
1
)
{
pIter
=
sdbFetch
(
pSdb
,
SDB_SUBSCRIBE
,
pIter
,
(
void
**
)
&
pSub
);
if
(
pIter
==
NULL
)
break
;
char
topic
[
TSDB_TOPIC_FNAME_LEN
];
char
cgroup
[
TSDB_CGROUP_LEN
];
mndSplitSubscribeKey
(
pSub
->
key
,
topic
,
cgroup
,
true
);
if
(
strcmp
(
topic
,
topicName
)
!=
0
)
{
sdbRelease
(
pSdb
,
pSub
);
continue
;
}
num
++
;
sdbRelease
(
pSdb
,
pSub
);
}
return
num
;
}
void
mndReleaseSubscribe
(
SMnode
*
pMnode
,
SMqSubscribeObj
*
pSub
)
{
void
mndReleaseSubscribe
(
SMnode
*
pMnode
,
SMqSubscribeObj
*
pSub
)
{
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
sdbRelease
(
pSdb
,
pSub
);
sdbRelease
(
pSdb
,
pSub
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录