Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d8a1f15d
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看板
提交
d8a1f15d
编写于
5月 04, 2023
作者:
L
liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix resum bug
上级
2fe494c2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
4 deletion
+12
-4
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+2
-0
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-1
source/dnode/vnode/src/tq/tqRestore.c
source/dnode/vnode/src/tq/tqRestore.c
+1
-1
source/libs/stream/src/stream.c
source/libs/stream/src/stream.c
+1
-1
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+6
-1
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
d8a1f15d
...
...
@@ -279,6 +279,7 @@ typedef struct SCheckpointInfo {
typedef
struct
SStreamStatus
{
int8_t
taskStatus
;
int8_t
schedStatus
;
int8_t
keepTaskStatus
;
}
SStreamStatus
;
struct
SStreamTask
{
...
...
@@ -539,6 +540,7 @@ int32_t streamTryExec(SStreamTask* pTask);
int32_t
streamSchedExec
(
SStreamTask
*
pTask
);
int32_t
streamTaskOutput
(
SStreamTask
*
pTask
,
SStreamDataBlock
*
pBlock
);
bool
streamTaskShouldStop
(
const
SStreamStatus
*
pStatus
);
bool
streamTaskShouldPause
(
const
SStreamStatus
*
pStatus
);
int32_t
streamScanExec
(
SStreamTask
*
pTask
,
int32_t
batchSz
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
d8a1f15d
...
...
@@ -1221,6 +1221,7 @@ int32_t tqProcessTaskPauseReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
SStreamTask
*
pTask
=
streamMetaAcquireTask
(
pTq
->
pStreamMeta
,
pReq
->
taskId
);
if
(
pTask
)
{
tqDebug
(
"vgId:%d s-task:%s set pause flag"
,
pTq
->
pStreamMeta
->
vgId
,
pTask
->
id
.
idStr
);
atomic_store_8
(
&
pTask
->
status
.
keepTaskStatus
,
pTask
->
status
.
taskStatus
);
atomic_store_8
(
&
pTask
->
status
.
taskStatus
,
TASK_STATUS__PAUSE
);
streamMetaReleaseTask
(
pTq
->
pStreamMeta
,
pTask
);
}
...
...
@@ -1231,7 +1232,7 @@ int32_t tqProcessTaskResumeReq(STQ* pTq, int64_t sversion, char* msg, int32_t ms
SVResumeStreamTaskReq
*
pReq
=
(
SVResumeStreamTaskReq
*
)
msg
;
SStreamTask
*
pTask
=
streamMetaAcquireTask
(
pTq
->
pStreamMeta
,
pReq
->
taskId
);
if
(
pTask
)
{
streamSetStatusNormal
(
pTask
);
atomic_store_8
(
&
pTask
->
status
.
taskStatus
,
pTask
->
status
.
keepTaskStatus
);
// no lock needs to secure the access of the version
if
(
pReq
->
igUntreated
)
{
// discard all the data when the stream task is suspended.
...
...
source/dnode/vnode/src/tq/tqRestore.c
浏览文件 @
d8a1f15d
...
...
@@ -106,7 +106,7 @@ int32_t createStreamRunReq(SStreamMeta* pStreamMeta, bool* pScanIdle) {
}
if
(
streamTaskShouldStop
(
&
pTask
->
status
)
||
status
==
TASK_STATUS__RECOVER_PREPARE
||
status
==
TASK_STATUS__WAIT_DOWNSTREAM
||
st
atus
==
TASK_STATUS__PAUSE
)
{
status
==
TASK_STATUS__WAIT_DOWNSTREAM
||
st
reamTaskShouldPause
(
&
pTask
->
status
)
)
{
tqDebug
(
"s-task:%s not ready for new submit block from wal, status:%d"
,
pTask
->
id
.
idStr
,
status
);
streamMetaReleaseTask
(
pStreamMeta
,
pTask
);
continue
;
...
...
source/libs/stream/src/stream.c
浏览文件 @
d8a1f15d
...
...
@@ -52,7 +52,7 @@ void streamCleanUp() {
void
streamSchedByTimer
(
void
*
param
,
void
*
tmrId
)
{
SStreamTask
*
pTask
=
(
void
*
)
param
;
if
(
streamTaskShouldStop
(
&
pTask
->
status
))
{
if
(
streamTaskShouldStop
(
&
pTask
->
status
)
||
streamTaskShouldPause
(
&
pTask
->
status
)
)
{
streamMetaReleaseTask
(
NULL
,
pTask
);
return
;
}
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
d8a1f15d
...
...
@@ -22,6 +22,11 @@ bool streamTaskShouldStop(const SStreamStatus* pStatus) {
return
(
status
==
TASK_STATUS__STOP
)
||
(
status
==
TASK_STATUS__DROPPING
);
}
bool
streamTaskShouldPause
(
const
SStreamStatus
*
pStatus
)
{
int32_t
status
=
atomic_load_8
((
int8_t
*
)
&
pStatus
->
taskStatus
);
return
(
status
==
TASK_STATUS__PAUSE
);
}
static
int32_t
streamTaskExecImpl
(
SStreamTask
*
pTask
,
const
void
*
data
,
SArray
*
pRes
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
void
*
pExecutor
=
pTask
->
exec
.
pExecutor
;
...
...
@@ -141,7 +146,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) {
int32_t
batchCnt
=
0
;
while
(
1
)
{
if
(
streamTaskShouldStop
(
&
pTask
->
status
))
{
if
(
streamTaskShouldStop
(
&
pTask
->
status
)
||
streamTaskShouldPause
(
&
pTask
->
status
)
)
{
taosArrayDestroy
(
pRes
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录