Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a18989df
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
a18989df
编写于
8月 17, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): add lost codes caused by merge 3.0.
上级
58c0a3d8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
11 deletion
+32
-11
include/common/tmsgdef.h
include/common/tmsgdef.h
+1
-0
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+27
-11
source/libs/stream/src/stream.c
source/libs/stream/src/stream.c
+4
-0
未找到文件。
include/common/tmsgdef.h
浏览文件 @
a18989df
...
...
@@ -184,6 +184,7 @@ enum {
TD_DEF_MSG_TYPE
(
TDMT_MND_RESUME_STREAM
,
"resume-stream"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_STREAM_CHECKPOINT_TIMER
,
"stream-checkpoint-tmr"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_STREAM_BEGIN_CHECKPOINT
,
"stream-begin-checkpoint"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_STREAM_NODECHANGE_CHECK
,
"stream-nodechange-check"
,
NULL
,
NULL
)
TD_NEW_MSG_SEG
(
TDMT_VND_MSG
)
TD_DEF_MSG_TYPE
(
TDMT_VND_SUBMIT
,
"submit"
,
SSubmitReq
,
SSubmitRsp
)
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
a18989df
...
...
@@ -40,11 +40,15 @@ typedef struct SNodeEntry {
}
SNodeEntry
;
typedef
struct
SStreamVnodeRevertIndex
{
SArray
*
pDBList
;
SArray
*
pNodeEntryList
;
int64_t
ts
;
// snapshot ts
}
SStreamVnodeRevertIndex
;
typedef
struct
SVgroupChangeInfo
{
SHashObj
*
pDBMap
;
SArray
*
pUpdateNodeList
;
//SArray<SNodeUpdateInfo>
}
SVgroupChangeInfo
;
static
int32_t
mndNodeCheckSentinel
=
0
;
static
SStreamVnodeRevertIndex
execNodeList
;
...
...
@@ -68,6 +72,7 @@ static int32_t mndProcessPauseStreamReq(SRpcMsg *pReq);
static
int32_t
mndProcessResumeStreamReq
(
SRpcMsg
*
pReq
);
static
int32_t
mndBuildStreamCheckpointSourceReq2
(
void
**
pBuf
,
int32_t
*
pLen
,
int32_t
nodeId
,
int64_t
checkpointId
,
int64_t
streamId
,
int32_t
taskId
);
static
int32_t
mndProcessNodeCheck
(
SRpcMsg
*
pReq
);
static
int32_t
mndProcessNodeCheckReq
(
SRpcMsg
*
pMsg
);
static
int32_t
mndPersistTransLog
(
SStreamObj
*
pStream
,
STrans
*
pTrans
);
...
...
@@ -86,7 +91,7 @@ int32_t mndInitStream(SMnode *pMnode) {
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CREATE_STREAM
,
mndProcessCreateStreamReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_DROP_STREAM
,
mndProcessDropStreamReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_NODECHECK_TIMER
,
mndProcessNodeCheck
Req
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_NODECHECK_TIMER
,
mndProcessNodeCheck
);
mndSetMsgHandle
(
pMnode
,
TDMT_STREAM_TASK_DEPLOY_RSP
,
mndTransProcessRsp
);
mndSetMsgHandle
(
pMnode
,
TDMT_STREAM_TASK_DROP_RSP
,
mndTransProcessRsp
);
...
...
@@ -100,6 +105,7 @@ int32_t mndInitStream(SMnode *pMnode) {
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_MND_STREAM_NODECHANGE_CHECK
,
mndProcessNodeCheckReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_PAUSE_STREAM
,
mndProcessPauseStreamReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_RESUME_STREAM
,
mndProcessResumeStreamReq
);
...
...
@@ -868,9 +874,9 @@ static int32_t mndProcessStreamCheckpointTmr(SRpcMsg *pReq) {
SMStreamDoCheckpointMsg
*
pMsg
=
rpcMallocCont
(
sizeof
(
SMStreamDoCheckpointMsg
));
pMsg
->
checkpointId
=
checkpointId
;
SRpcMsg
rpcMsg
=
{
.
msgType
=
TDMT_MND_STREAM_BEGIN_CHECKPOINT
,
.
pCont
=
pMsg
,
.
contLen
=
sizeof
(
SMStreamDoCheckpointMsg
)
};
//
tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg);
int32_t
size
=
sizeof
(
SMStreamDoCheckpointMsg
);
SRpcMsg
rpcMsg
=
{
.
msgType
=
TDMT_MND_STREAM_BEGIN_CHECKPOINT
,
.
pCont
=
pMsg
,
.
contLen
=
size
};
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
WRITE_QUEUE
,
&
rpcMsg
);
return
0
;
}
...
...
@@ -1741,11 +1747,6 @@ static int32_t mndProcessResumeStreamReq(SRpcMsg *pReq) {
return
TSDB_CODE_ACTION_IN_PROGRESS
;
}
typedef
struct
SVgroupChangeInfo
{
SHashObj
*
pDBMap
;
SArray
*
pUpdateNodeList
;
//SArray<SNodeUpdateInfo>
}
SVgroupChangeInfo
;
static
void
initNodeUpdateMsg
(
SStreamTaskNodeUpdateMsg
*
pMsg
,
const
SVgroupChangeInfo
*
pInfo
,
int64_t
streamId
,
int32_t
taskId
)
{
pMsg
->
streamId
=
streamId
;
pMsg
->
taskId
=
taskId
;
...
...
@@ -1973,7 +1974,7 @@ static SArray* mndTakeVgroupSnapshot(SMnode* pMnode) {
return
pVgroupListSnapshot
;
}
int32_t
mndProcessVgroupChange
(
SMnode
*
pMnode
,
SVgroupChangeInfo
*
pChangeInfo
)
{
static
int32_t
mndProcessVgroupChange
(
SMnode
*
pMnode
,
SVgroupChangeInfo
*
pChangeInfo
)
{
SSdb
*
pSdb
=
pMnode
->
pSdb
;
// check all streams that involved this vnode should update the epset info
...
...
@@ -2093,6 +2094,21 @@ static int32_t mndProcessNodeCheckReq(SRpcMsg *pMsg) {
return
0
;
}
typedef
struct
SMStreamNodeCheckMsg
{}
SMStreamNodeCheckMsg
;
static
int32_t
mndProcessNodeCheck
(
SRpcMsg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
if
(
sdbGetSize
(
pSdb
,
SDB_STREAM
)
<=
0
)
{
return
0
;
}
SMStreamNodeCheckMsg
*
pMsg
=
rpcMallocCont
(
sizeof
(
SMStreamNodeCheckMsg
));
SRpcMsg
rpcMsg
=
{
.
msgType
=
TDMT_MND_STREAM_NODECHANGE_CHECK
,
.
pCont
=
pMsg
,
.
contLen
=
sizeof
(
SMStreamNodeCheckMsg
)};
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
WRITE_QUEUE
,
&
rpcMsg
);
return
0
;
}
// todo: this process should be executed by the write queue worker of the mnode
//int32_t mndProcessStreamHb(SRpcMsg *pReq) {
// SMnode *pMnode = pReq->info.node;
...
...
source/libs/stream/src/stream.c
浏览文件 @
a18989df
...
...
@@ -171,6 +171,10 @@ static int32_t streamTaskAppendInputBlocks(SStreamTask* pTask, const SStreamDisp
qError
(
"vgId:%d, s-task:%s failed to receive dispatch msg, reason: out of memory"
,
pTask
->
pMeta
->
vgId
,
pTask
->
id
.
idStr
);
}
else
{
if
(
pBlock
->
type
==
STREAM_INPUT__TRANS_STATE
)
{
pTask
->
status
.
appendTranstateBlock
=
true
;
}
int32_t
code
=
tAppendDataToInputQueue
(
pTask
,
(
SStreamQueueItem
*
)
pBlock
);
// input queue is full, upstream is blocked now
status
=
(
code
==
TSDB_CODE_SUCCESS
)
?
TASK_INPUT_STATUS__NORMAL
:
TASK_INPUT_STATUS__BLOCKED
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录