Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9a3708e1
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看板
提交
9a3708e1
编写于
6月 14, 2023
作者:
L
liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pause&resume fill history
上级
7c6fbd77
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
32 addition
and
22 deletion
+32
-22
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+4
-2
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+4
-2
source/libs/stream/src/streamRecover.c
source/libs/stream/src/streamRecover.c
+24
-18
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
9a3708e1
...
...
@@ -451,7 +451,8 @@ typedef struct {
SMsgHead
msgHead
;
int64_t
streamId
;
int32_t
taskId
;
}
SStreamScanHistoryReq
,
SStreamRecoverStep2Req
;
int8_t
igUntreated
;
}
SStreamScanHistoryReq
;
typedef
struct
{
int64_t
streamId
;
...
...
@@ -574,6 +575,7 @@ int32_t streamTaskCheckStatus(SStreamTask* pTask);
int32_t
streamProcessCheckRsp
(
SStreamTask
*
pTask
,
const
SStreamTaskCheckRsp
*
pRsp
);
int32_t
streamTaskStartHistoryTask
(
SStreamTask
*
pTask
);
int32_t
streamTaskScanHistoryDataComplete
(
SStreamTask
*
pTask
);
int32_t
streamStartRecoverTask
(
SStreamTask
*
pTask
,
int8_t
igUntreated
);
// common
int32_t
streamSetParamForScanHistoryData
(
SStreamTask
*
pTask
);
...
...
@@ -583,7 +585,7 @@ const char* streamGetTaskStatusStr(int32_t status);
// source level
int32_t
streamSetParamForStreamScanner
(
SStreamTask
*
pTask
,
SVersionRange
*
pVerRange
,
STimeWindow
*
pWindow
);
int32_t
streamBuildSourceRecover1Req
(
SStreamTask
*
pTask
,
SStreamScanHistoryReq
*
pReq
);
int32_t
streamBuildSourceRecover1Req
(
SStreamTask
*
pTask
,
SStreamScanHistoryReq
*
pReq
,
int8_t
igUntreated
);
int32_t
streamSourceScanHistoryData
(
SStreamTask
*
pTask
);
//int32_t streamSourceRecoverScanStep2(SStreamTask* pTask, int64_t ver);
int32_t
streamDispatchScanHistoryFinishMsg
(
SStreamTask
*
pTask
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
9a3708e1
...
...
@@ -1468,7 +1468,7 @@ int32_t tqProcessTaskResumeReq(STQ* pTq, int64_t sversion, char* msg, int32_t ms
atomic_store_8
(
&
pTask
->
status
.
taskStatus
,
pTask
->
status
.
keepTaskStatus
);
// no lock needs to secure the access of the version
if
(
pReq
->
igUntreated
&&
pTask
->
info
.
taskLevel
==
TASK_LEVEL__SOURCE
)
{
if
(
pReq
->
igUntreated
&&
pTask
->
info
.
taskLevel
==
TASK_LEVEL__SOURCE
&&
!
pTask
->
info
.
fillHistory
)
{
// discard all the data when the stream task is suspended.
walReaderSetSkipToVersion
(
pTask
->
exec
.
pWalReader
,
sversion
);
tqDebug
(
"vgId:%d s-task:%s resume to exec, prev paused version:%"
PRId64
", start from vnode ver:%"
PRId64
...
...
@@ -1479,7 +1479,9 @@ int32_t tqProcessTaskResumeReq(STQ* pTq, int64_t sversion, char* msg, int32_t ms
vgId
,
pTask
->
id
.
idStr
,
pTask
->
chkInfo
.
currentVer
,
sversion
,
pTask
->
status
.
schedStatus
);
}
if
(
pTask
->
info
.
taskLevel
==
TASK_LEVEL__SOURCE
&&
taosQueueItemSize
(
pTask
->
inputQueue
->
queue
)
==
0
)
{
if
(
pTask
->
info
.
fillHistory
&&
pTask
->
info
.
taskLevel
==
TASK_LEVEL__SOURCE
)
{
streamStartRecoverTask
(
pTask
,
pReq
->
igUntreated
);
}
else
if
(
pTask
->
info
.
taskLevel
==
TASK_LEVEL__SOURCE
&&
taosQueueItemSize
(
pTask
->
inputQueue
->
queue
)
==
0
)
{
tqStartStreamTasks
(
pTq
);
}
else
{
streamSchedExec
(
pTask
);
...
...
source/libs/stream/src/streamRecover.c
浏览文件 @
9a3708e1
...
...
@@ -17,6 +17,26 @@
#include "ttimer.h"
#include "wal.h"
int32_t
streamStartRecoverTask
(
SStreamTask
*
pTask
,
int8_t
igUntreated
)
{
SStreamScanHistoryReq
req
;
streamBuildSourceRecover1Req
(
pTask
,
&
req
,
igUntreated
);
int32_t
len
=
sizeof
(
SStreamScanHistoryReq
);
void
*
serializedReq
=
rpcMallocCont
(
len
);
if
(
serializedReq
==
NULL
)
{
return
-
1
;
}
memcpy
(
serializedReq
,
&
req
,
len
);
SRpcMsg
rpcMsg
=
{.
contLen
=
len
,
.
pCont
=
serializedReq
,
.
msgType
=
TDMT_VND_STREAM_SCAN_HISTORY
};
if
(
tmsgPutToQueue
(
pTask
->
pMsgCb
,
STREAM_QUEUE
,
&
rpcMsg
)
<
0
)
{
/*ASSERT(0);*/
}
return
0
;
}
const
char
*
streamGetTaskStatusStr
(
int32_t
status
)
{
switch
(
status
)
{
case
TASK_STATUS__NORMAL
:
return
"normal"
;
...
...
@@ -38,23 +58,8 @@ static int32_t doLaunchScanHistoryTask(SStreamTask* pTask) {
streamSetParamForScanHistoryData
(
pTask
);
streamSetParamForStreamScanner
(
pTask
,
pRange
,
&
pTask
->
dataRange
.
window
);
SStreamScanHistoryReq
req
;
streamBuildSourceRecover1Req
(
pTask
,
&
req
);
int32_t
len
=
sizeof
(
SStreamScanHistoryReq
);
void
*
serializedReq
=
rpcMallocCont
(
len
);
if
(
serializedReq
==
NULL
)
{
return
-
1
;
}
memcpy
(
serializedReq
,
&
req
,
len
);
SRpcMsg
rpcMsg
=
{.
contLen
=
len
,
.
pCont
=
serializedReq
,
.
msgType
=
TDMT_VND_STREAM_SCAN_HISTORY
};
if
(
tmsgPutToQueue
(
pTask
->
pMsgCb
,
STREAM_QUEUE
,
&
rpcMsg
)
<
0
)
{
/*ASSERT(0);*/
}
return
0
;
int32_t
code
=
streamStartRecoverTask
(
pTask
,
0
);
return
code
;
}
int32_t
streamTaskLaunchScanHistory
(
SStreamTask
*
pTask
)
{
...
...
@@ -262,10 +267,11 @@ int32_t streamSetParamForStreamScanner(SStreamTask* pTask, SVersionRange *pVerRa
return
qStreamSourceScanParamForHistoryScan
(
pTask
->
exec
.
pExecutor
,
pVerRange
,
pWindow
);
}
int32_t
streamBuildSourceRecover1Req
(
SStreamTask
*
pTask
,
SStreamScanHistoryReq
*
pReq
)
{
int32_t
streamBuildSourceRecover1Req
(
SStreamTask
*
pTask
,
SStreamScanHistoryReq
*
pReq
,
int8_t
igUntreated
)
{
pReq
->
msgHead
.
vgId
=
pTask
->
info
.
nodeId
;
pReq
->
streamId
=
pTask
->
id
.
streamId
;
pReq
->
taskId
=
pTask
->
id
.
taskId
;
pReq
->
igUntreated
=
igUntreated
;
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录