Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
128f6778
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看板
提交
128f6778
编写于
7月 07, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): fix error in parsing checkpoint msg.
上级
b03ca31a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
12 deletion
+17
-12
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+1
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+14
-5
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+2
-6
未找到文件。
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
128f6778
...
...
@@ -219,7 +219,7 @@ int tqPushMsg(STQ*, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver);
int
tqRegisterPushHandle
(
STQ
*
pTq
,
void
*
handle
,
SRpcMsg
*
pMsg
);
int
tqUnregisterPushHandle
(
STQ
*
pTq
,
void
*
pHandle
);
int
tqStartStreamTasks
(
STQ
*
pTq
);
// restore all stream tasks after vnode launching completed.
int32_t
tqProcessStreamCheckPointSourceReq
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
msg
,
int32_t
msgLen
);
int32_t
tqProcessStreamCheckPointSourceReq
(
STQ
*
pTq
,
SRpcMsg
*
pMsg
);
int32_t
tqProcessStreamCheckPointReq
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
msg
,
int32_t
msgLen
);
int32_t
tqProcessStreamCheckPointRsp
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
msg
,
int32_t
msgLen
);
int32_t
tqCheckStreamStatus
(
STQ
*
pTq
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
128f6778
...
...
@@ -1492,14 +1492,14 @@ FAIL:
int32_t
tqCheckLogInWal
(
STQ
*
pTq
,
int64_t
sversion
)
{
return
sversion
<=
pTq
->
walLogLastVer
;
}
int32_t
tqProcessStreamCheckPointSourceReq
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
pMsg
,
int32_t
msgLen
)
{
int32_t
tqProcessStreamCheckPointSourceReq
(
STQ
*
pTq
,
SRpcMsg
*
pMsg
)
{
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
SStreamMeta
*
pMeta
=
pTq
->
pStreamMeta
;
char
*
msg
=
POINTER_SHIFT
(
pMsg
,
sizeof
(
SMsgHead
));
int32_t
len
=
msg
Len
-
sizeof
(
SMsgHead
);
char
*
msg
=
POINTER_SHIFT
(
pMsg
->
pCont
,
sizeof
(
SMsgHead
));
int32_t
len
=
pMsg
->
cont
Len
-
sizeof
(
SMsgHead
);
int32_t
code
=
0
;
SStreamCheckpointSourceReq
req
=
{
0
};
SStreamCheckpointSourceReq
req
=
{
0
};
SDecoder
decoder
;
tDecoderInit
(
&
decoder
,
(
uint8_t
*
)
msg
,
len
);
...
...
@@ -1524,11 +1524,20 @@ int32_t tqProcessStreamCheckPointSourceReq(STQ* pTq, int64_t sversion, char* pMs
taosArrayPush
(
pTask
->
pRpcMsgList
,
&
pRpcMsg
);
// todo: when generating checkpoint, no new tasks are allowed to add into current Vnode
// set the initial value for generating check point
int32_t
total
=
0
;
taosWLockLatch
(
&
pMeta
->
lock
);
pMeta
->
chkptNotReadyTasks
=
taosArrayGetSize
(
pMeta
->
pTaskList
);
if
(
pMeta
->
chkptNotReadyTasks
==
0
)
{
pMeta
->
chkptNotReadyTasks
=
taosArrayGetSize
(
pMeta
->
pTaskList
);
}
total
=
taosArrayGetSize
(
pMeta
->
pTaskList
);
taosWUnLockLatch
(
&
pMeta
->
lock
);
qDebug
(
"s-task:%s level:%d receive the checkpoint msg id:%"
PRId64
" from mnode, total source checkpoint req:%d"
,
pTask
->
id
.
idStr
,
pTask
->
info
.
taskLevel
,
req
.
checkpointId
,
total
);
streamProcessCheckpointSourceReq
(
pMeta
,
pTask
,
&
req
);
streamMetaReleaseTask
(
pMeta
,
pTask
);
return
code
;
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
128f6778
...
...
@@ -498,12 +498,6 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t ver, SRpcMsg
}
}
break
;
case
TDMT_VND_STREAM_CHECK_POINT_SOURCE
:
{
if
(
tqProcessStreamCheckPointSourceReq
(
pVnode
->
pTq
,
ver
,
pMsg
->
pCont
,
pMsg
->
contLen
)
<
0
)
{
goto
_err
;
}
}
break
;
case
TDMT_STREAM_TASK_CHECKPOINT
:
{
if
(
tqProcessStreamCheckPointReq
(
pVnode
->
pTq
,
ver
,
pMsg
->
pCont
,
pMsg
->
contLen
)
<
0
)
{
goto
_err
;
...
...
@@ -688,6 +682,8 @@ int32_t vnodeProcessStreamMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo)
return
tqProcessStreamTaskScanHistoryFinishReq
(
pVnode
->
pTq
,
pMsg
);
case
TDMT_STREAM_SCAN_HISTORY_FINISH_RSP
:
return
tqProcessTaskRecoverFinishRsp
(
pVnode
->
pTq
,
pMsg
);
case
TDMT_VND_STREAM_CHECK_POINT_SOURCE
:
return
tqProcessStreamCheckPointSourceReq
(
pVnode
->
pTq
,
pMsg
);
default:
vError
(
"unknown msg type:%d in stream queue"
,
pMsg
->
msgType
);
return
TSDB_CODE_APP_ERROR
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录