Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a0dcec58
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a0dcec58
编写于
8月 08, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh(stream): add function handler for hb message.
上级
af3a8756
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
3 deletion
+13
-3
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+2
-0
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+11
-3
未找到文件。
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
a0dcec58
...
@@ -54,6 +54,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq);
...
@@ -54,6 +54,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq);
static
int32_t
mndProcessDropStreamReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessDropStreamReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessStreamCheckpointTmr
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessStreamCheckpointTmr
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessStreamDoCheckpoint
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessStreamDoCheckpoint
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessStreamHb
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessRecoverStreamReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessRecoverStreamReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessStreamMetaReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessStreamMetaReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndGetStreamMeta
(
SRpcMsg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndGetStreamMeta
(
SRpcMsg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
...
@@ -92,6 +93,7 @@ int32_t mndInitStream(SMnode *pMnode) {
...
@@ -92,6 +93,7 @@ int32_t mndInitStream(SMnode *pMnode) {
mndSetMsgHandle
(
pMnode
,
TDMT_VND_STREAM_CHECK_POINT_SOURCE_RSP
,
mndTransProcessRsp
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_STREAM_CHECK_POINT_SOURCE_RSP
,
mndTransProcessRsp
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_STREAM_CHECKPOINT_TIMER
,
mndProcessStreamCheckpointTmr
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_STREAM_CHECKPOINT_TIMER
,
mndProcessStreamCheckpointTmr
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_STREAM_BEGIN_CHECKPOINT
,
mndProcessStreamDoCheckpoint
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_STREAM_BEGIN_CHECKPOINT
,
mndProcessStreamDoCheckpoint
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_STREAM_HEARTBEAT
,
mndProcessStreamHb
);
mndSetMsgHandle
(
pMnode
,
TDMT_STREAM_TASK_REPORT_CHECKPOINT
,
mndTransProcessRsp
);
mndSetMsgHandle
(
pMnode
,
TDMT_STREAM_TASK_REPORT_CHECKPOINT
,
mndTransProcessRsp
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_PAUSE_STREAM
,
mndProcessPauseStreamReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_PAUSE_STREAM
,
mndProcessPauseStreamReq
);
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
a0dcec58
...
@@ -93,7 +93,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
...
@@ -93,7 +93,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
pMeta
->
expandFunc
=
expandFunc
;
pMeta
->
expandFunc
=
expandFunc
;
// send heartbeat every 20sec.
// send heartbeat every 20sec.
// pMeta->hbTmr = taosTmrStart(metaHbToMnode, 20000,
pMeta
, streamEnv.timer);
// pMeta->hbTmr = taosTmrStart(metaHbToMnode, 20000,
ahandle
, streamEnv.timer);
pMeta
->
pTaskBackendUnique
=
pMeta
->
pTaskBackendUnique
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_ENTRY_LOCK
);
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_ENTRY_LOCK
);
...
@@ -549,9 +549,17 @@ int32_t tDecodeStreamHbMsg(SDecoder* pDecoder, SStreamHbMsg* pReq) {
...
@@ -549,9 +549,17 @@ int32_t tDecodeStreamHbMsg(SDecoder* pDecoder, SStreamHbMsg* pReq) {
}
}
void
metaHbToMnode
(
void
*
param
,
void
*
tmrId
)
{
void
metaHbToMnode
(
void
*
param
,
void
*
tmrId
)
{
S
StreamMeta
*
pMeta
=
param
;
S
TQ
*
pMeta
=
param
;
SStreamHbMsg
hbMsg
=
{
0
};
SStreamHbMsg
hbMsg
=
{
0
};
taosRLockLatch
(
&
pMeta
->
lock
);
int32_t
numOfTasks
=
streamMetaGetNumOfTasks
(
pMeta
);
taosRUnLockLatch
(
&
pMeta
->
lock
);
hbMsg
.
numOfTasks
=
numOfTasks
;
hbMsg
.
vgId
=
pMeta
->
vgId
;
hbMsg
.
epset
=
;
int32_t
code
=
0
;
int32_t
code
=
0
;
int32_t
tlen
=
0
;
int32_t
tlen
=
0
;
...
@@ -581,7 +589,7 @@ void metaHbToMnode(void* param, void* tmrId) {
...
@@ -581,7 +589,7 @@ void metaHbToMnode(void* param, void* tmrId) {
SRpcMsg
msg
=
{
0
};
SRpcMsg
msg
=
{
0
};
initRpcMsg
(
&
msg
,
TDMT_MND_STREAM_HEARTBEAT
,
buf
,
tlen
+
sizeof
(
SMsgHead
));
initRpcMsg
(
&
msg
,
TDMT_MND_STREAM_HEARTBEAT
,
buf
,
tlen
+
sizeof
(
SMsgHead
));
qDebug
(
"vgId:%d, send hb to mnode"
,
pMeta
->
mgmtInfo
.
mnodeId
);
qDebug
(
"vgId:%d,
build and
send hb to mnode"
,
pMeta
->
mgmtInfo
.
mnodeId
);
tmsgSendReq
(
&
pMeta
->
mgmtInfo
.
epset
,
&
msg
);
tmsgSendReq
(
&
pMeta
->
mgmtInfo
.
epset
,
&
msg
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录