Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9f943213
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看板
提交
9f943213
编写于
7月 28, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh(stream): update the hb info.
上级
74834aea
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
17 deletion
+32
-17
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+7
-0
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+5
-0
source/libs/stream/src/streamCheckpoint.c
source/libs/stream/src/streamCheckpoint.c
+2
-0
source/libs/stream/src/streamDispatch.c
source/libs/stream/src/streamDispatch.c
+1
-0
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+17
-17
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
9f943213
...
@@ -352,6 +352,11 @@ struct SStreamTask {
...
@@ -352,6 +352,11 @@ struct SStreamTask {
SSHashObj
*
pNameMap
;
SSHashObj
*
pNameMap
;
};
};
typedef
struct
SMgmtInfo
{
SEpSet
epset
;
int32_t
mnodeId
;
}
SMgmtInfo
;
// meta
// meta
typedef
struct
SStreamMeta
{
typedef
struct
SStreamMeta
{
char
*
path
;
char
*
path
;
...
@@ -371,6 +376,7 @@ typedef struct SStreamMeta {
...
@@ -371,6 +376,7 @@ typedef struct SStreamMeta {
SHashObj
*
pTaskBackendUnique
;
SHashObj
*
pTaskBackendUnique
;
TdThreadMutex
backendMutex
;
TdThreadMutex
backendMutex
;
tmr_h
hbTmr
;
tmr_h
hbTmr
;
SMgmtInfo
mgmtInfo
;
int32_t
chkptNotReadyTasks
;
int32_t
chkptNotReadyTasks
;
SArray
*
checkpointSaved
;
SArray
*
checkpointSaved
;
...
@@ -484,6 +490,7 @@ typedef struct {
...
@@ -484,6 +490,7 @@ typedef struct {
int64_t
checkpointId
;
int64_t
checkpointId
;
int32_t
taskId
;
int32_t
taskId
;
int32_t
nodeId
;
int32_t
nodeId
;
SEpSet
mgmtEps
;
int32_t
mnodeId
;
int32_t
mnodeId
;
int64_t
expireTime
;
int64_t
expireTime
;
}
SStreamCheckpointSourceReq
;
}
SStreamCheckpointSourceReq
;
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
9f943213
...
@@ -1668,6 +1668,11 @@ int32_t tqProcessStreamCheckPointSourceReq(STQ* pTq, SRpcMsg* pMsg) {
...
@@ -1668,6 +1668,11 @@ int32_t tqProcessStreamCheckPointSourceReq(STQ* pTq, SRpcMsg* pMsg) {
// set the initial value for generating check point
// set the initial value for generating check point
int32_t
total
=
0
;
int32_t
total
=
0
;
taosWLockLatch
(
&
pMeta
->
lock
);
taosWLockLatch
(
&
pMeta
->
lock
);
// set the mgmt epset info according to the checkout source msg from mnode, todo opt perf
pMeta
->
mgmtInfo
.
epset
=
req
.
mgmtEps
;
pMeta
->
mgmtInfo
.
mnodeId
=
req
.
mnodeId
;
if
(
pMeta
->
chkptNotReadyTasks
==
0
)
{
if
(
pMeta
->
chkptNotReadyTasks
==
0
)
{
pMeta
->
chkptNotReadyTasks
=
taosArrayGetSize
(
pMeta
->
pTaskList
);
pMeta
->
chkptNotReadyTasks
=
taosArrayGetSize
(
pMeta
->
pTaskList
);
}
}
...
...
source/libs/stream/src/streamCheckpoint.c
浏览文件 @
9f943213
...
@@ -21,6 +21,7 @@ int32_t tEncodeStreamCheckpointSourceReq(SEncoder* pEncoder, const SStreamCheckp
...
@@ -21,6 +21,7 @@ int32_t tEncodeStreamCheckpointSourceReq(SEncoder* pEncoder, const SStreamCheckp
if
(
tEncodeI64
(
pEncoder
,
pReq
->
checkpointId
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pReq
->
checkpointId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pReq
->
taskId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pReq
->
taskId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pReq
->
nodeId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pReq
->
nodeId
)
<
0
)
return
-
1
;
if
(
tEncodeSEpSet
(
pEncoder
,
&
pReq
->
mgmtEps
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pReq
->
mnodeId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pReq
->
mnodeId
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pReq
->
expireTime
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pReq
->
expireTime
)
<
0
)
return
-
1
;
tEndEncode
(
pEncoder
);
tEndEncode
(
pEncoder
);
...
@@ -33,6 +34,7 @@ int32_t tDecodeStreamCheckpointSourceReq(SDecoder* pDecoder, SStreamCheckpointSo
...
@@ -33,6 +34,7 @@ int32_t tDecodeStreamCheckpointSourceReq(SDecoder* pDecoder, SStreamCheckpointSo
if
(
tDecodeI64
(
pDecoder
,
&
pReq
->
checkpointId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pReq
->
checkpointId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pReq
->
taskId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pReq
->
taskId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pReq
->
nodeId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pReq
->
nodeId
)
<
0
)
return
-
1
;
if
(
tDecodeSEpSet
(
pDecoder
,
&
pReq
->
mgmtEps
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pReq
->
mnodeId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pReq
->
mnodeId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pReq
->
expireTime
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pReq
->
expireTime
)
<
0
)
return
-
1
;
tEndDecode
(
pDecoder
);
tEndDecode
(
pDecoder
);
...
...
source/libs/stream/src/streamDispatch.c
浏览文件 @
9f943213
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include "streamInt.h"
#include "streamInt.h"
#include "trpc.h"
#include "trpc.h"
#include "ttimer.h"
#include "ttimer.h"
#include "tmisce.h"
#define MAX_BLOCK_NAME_NUM 1024
#define MAX_BLOCK_NAME_NUM 1024
#define DISPATCH_RETRY_INTERVAL_MS 300
#define DISPATCH_RETRY_INTERVAL_MS 300
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
9f943213
...
@@ -542,21 +542,21 @@ void metaHbToMnode(void* param, void* tmrId) {
...
@@ -542,21 +542,21 @@ void metaHbToMnode(void* param, void* tmrId) {
return
;
return
;
}
}
// ((SMsgHead*)buf)->vgId = htonl(
nodeId);
((
SMsgHead
*
)
buf
)
->
vgId
=
htonl
(
pMeta
->
mgmtInfo
.
m
nodeId
);
//
void* pBuf = POINTER_SHIFT(buf, sizeof(SMsgHead));
void
*
pBuf
=
POINTER_SHIFT
(
buf
,
sizeof
(
SMsgHead
));
//
//
SEncoder encoder;
SEncoder
encoder
;
//
tEncoderInit(&encoder, pBuf, tlen);
tEncoderInit
(
&
encoder
,
pBuf
,
tlen
);
//
if ((code = tEncodeStreamHbMsg(&encoder, &hbMsg)) < 0) {
if
((
code
=
tEncodeStreamHbMsg
(
&
encoder
,
&
hbMsg
))
<
0
)
{
//
rpcFreeCont(buf);
rpcFreeCont
(
buf
);
//
qError("vgId:%d encode stream hb msg failed, code:%s", pMeta->vgId, tstrerror(code));
qError
(
"vgId:%d encode stream hb msg failed, code:%s"
,
pMeta
->
vgId
,
tstrerror
(
code
));
//
return;
return
;
//
}
}
//
tEncoderClear(&encoder);
tEncoderClear
(
&
encoder
);
//
//
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",
nodeId);
qDebug
(
"vgId:%d, send hb to mnode"
,
pMeta
->
mgmtInfo
.
m
nodeId
);
//
// tmsgSendReq(pEpS
et, &msg);
tmsgSendReq
(
&
pMeta
->
mgmtInfo
.
eps
et
,
&
msg
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录