Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
17c61434
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看板
提交
17c61434
编写于
8月 08, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): check more status when handling the state transfer.
上级
db8ce3de
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
13 deletion
+14
-13
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+7
-9
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-1
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+4
-2
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+2
-1
未找到文件。
source/dnode/vnode/src/tq/tq.c
浏览文件 @
17c61434
...
...
@@ -1277,7 +1277,6 @@ int32_t tqProcessTaskScanHistory(STQ* pTq, SRpcMsg* pMsg) {
if
(
done
)
{
pTask
->
tsInfo
.
step2Start
=
taosGetTimestampMs
();
streamTaskEndScanWAL
(
pTask
);
streamMetaReleaseTask
(
pMeta
,
pTask
);
}
else
{
STimeWindow
*
pWindow
=
&
pTask
->
dataRange
.
window
;
tqDebug
(
"s-task:%s level:%d verRange:%"
PRId64
" - %"
PRId64
" window:%"
PRId64
"-%"
PRId64
...
...
@@ -1303,13 +1302,11 @@ int32_t tqProcessTaskScanHistory(STQ* pTq, SRpcMsg* pMsg) {
streamSetStatusNormal
(
pTask
);
}
// 4. 1) transfer the ownership of executor state, 2) update the scan data range for source task.
// 5. resume the related stream task.
streamMetaReleaseTask
(
pMeta
,
pTask
);
streamMetaReleaseTask
(
pMeta
,
pStreamTask
);
tqStartStreamTasks
(
pTq
);
}
streamMetaReleaseTask
(
pMeta
,
pTask
);
streamMetaReleaseTask
(
pMeta
,
pStreamTask
);
}
else
{
// todo update the chkInfo version for current task.
// this task has an associated history stream task, so we need to scan wal from the end version of
...
...
@@ -1515,7 +1512,7 @@ int32_t tqProcessTaskRunReq(STQ* pTq, SRpcMsg* pMsg) {
if
(
pTask
!=
NULL
)
{
// even in halt status, the data in inputQ must be processed
int8_t
st
=
pTask
->
status
.
taskStatus
;
if
(
st
==
TASK_STATUS__NORMAL
||
st
==
TASK_STATUS__SCAN_HISTORY
/* || st == TASK_STATUS__SCAN_HISTORY_WAL*/
)
{
if
(
st
==
TASK_STATUS__NORMAL
||
st
==
TASK_STATUS__SCAN_HISTORY
)
{
tqDebug
(
"vgId:%d s-task:%s start to process block from inputQ, last chk point:%"
PRId64
,
vgId
,
pTask
->
id
.
idStr
,
pTask
->
chkInfo
.
version
);
streamProcessRunReq
(
pTask
);
...
...
@@ -1528,8 +1525,9 @@ int32_t tqProcessTaskRunReq(STQ* pTq, SRpcMsg* pMsg) {
streamMetaReleaseTask
(
pTq
->
pStreamMeta
,
pTask
);
tqStartStreamTasks
(
pTq
);
return
0
;
}
else
{
tqError
(
"vgId:%d failed to found s-task, taskId:%d"
,
vgId
,
taskId
);
}
else
{
// NOTE: pTask->status.schedStatus is not updated since it is not be handled by the run exec.
// todo add one function to handle this
tqError
(
"vgId:%d failed to found s-task, taskId:0x%x may have been dropped"
,
vgId
,
taskId
);
return
-
1
;
}
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
17c61434
...
...
@@ -1046,7 +1046,7 @@ int32_t qStreamInfoResetTimewindowFilter(qTaskInfo_t tinfo) {
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
tinfo
;
STimeWindow
*
pWindow
=
&
pTaskInfo
->
streamInfo
.
fillHistoryWindow
;
qDebug
(
"%s
set remove scan-history filter window:%"
PRId64
"-%"
PRId64
",
new window:%"
PRId64
"-%"
PRId64
,
qDebug
(
"%s
remove scan-history filter window:%"
PRId64
"-%"
PRId64
", set
new window:%"
PRId64
"-%"
PRId64
,
GET_TASKID
(
pTaskInfo
),
pWindow
->
skey
,
pWindow
->
ekey
,
INT64_MIN
,
INT64_MAX
);
pWindow
->
skey
=
INT64_MIN
;
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
17c61434
...
...
@@ -545,8 +545,11 @@ int32_t streamExecForAll(SStreamTask* pTask) {
return
0
;
}
// the task may be set dropping/stopping, while it is still in the task queue, therefore, the sched-status can not
// be updated by tryExec function, therefore, the schedStatus will always be the TASK_SCHED_STATUS__WAITING.
bool
streamTaskIsIdle
(
const
SStreamTask
*
pTask
)
{
return
(
pTask
->
status
.
schedStatus
==
TASK_SCHED_STATUS__INACTIVE
);
return
(
pTask
->
status
.
schedStatus
==
TASK_SCHED_STATUS__INACTIVE
||
pTask
->
status
.
taskStatus
==
TASK_STATUS__STOP
||
pTask
->
status
.
taskStatus
==
TASK_STATUS__DROPPING
);
}
int32_t
streamTaskEndScanWAL
(
SStreamTask
*
pTask
)
{
...
...
@@ -584,7 +587,6 @@ int32_t streamTryExec(SStreamTask* pTask) {
return
-
1
;
}
// todo the task should be commit here
// todo the task should be commit here
if
(
taosQueueEmpty
(
pTask
->
inputQueue
->
queue
))
{
// fill-history WAL scan has completed
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
17c61434
...
...
@@ -330,7 +330,8 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int32_t taskId) {
}
taosWUnLockLatch
(
&
pMeta
->
lock
);
qDebug
(
"s-task:0x%x set task status:%s"
,
taskId
,
streamGetTaskStatusStr
(
TASK_STATUS__DROPPING
));
qDebug
(
"s-task:0x%x set task status:%s and start to unregister it"
,
taskId
,
streamGetTaskStatusStr
(
TASK_STATUS__DROPPING
));
while
(
1
)
{
taosRLockLatch
(
&
pMeta
->
lock
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录