Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9f301bdd
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看板
未验证
提交
9f301bdd
编写于
7月 27, 2023
作者:
H
Haojun Liao
提交者:
GitHub
7月 27, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22218 from taosdata/fix/TD-24620
adjust history task trigger mode
上级
5ca52ce7
5d21f503
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
8 deletion
+35
-8
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+22
-2
source/libs/stream/src/streamRecover.c
source/libs/stream/src/streamRecover.c
+13
-6
未找到文件。
source/libs/executor/src/timewindowoperator.c
浏览文件 @
9f301bdd
...
...
@@ -3737,7 +3737,18 @@ void streamSessionReloadState(SOperatorInfo* pOperator) {
int32_t
winNum
=
compactSessionWindow
(
pOperator
,
&
winInfo
,
pInfo
->
pStUpdated
,
pInfo
->
pStDeleted
,
true
);
if
(
winNum
>
0
)
{
saveSessionOutputBuf
(
pAggSup
,
&
winInfo
);
saveResult
(
winInfo
,
pInfo
->
pStUpdated
);
if
(
pInfo
->
twAggSup
.
calTrigger
==
STREAM_TRIGGER_AT_ONCE
)
{
saveResult
(
winInfo
,
pInfo
->
pStUpdated
);
}
else
if
(
pInfo
->
twAggSup
.
calTrigger
==
STREAM_TRIGGER_WINDOW_CLOSE
)
{
if
(
!
isCloseWindow
(
&
winInfo
.
sessionWin
.
win
,
&
pInfo
->
twAggSup
))
{
saveDeleteRes
(
pInfo
->
pStDeleted
,
winInfo
.
sessionWin
);
}
SSessionKey
key
=
{
0
};
getSessionHashKey
(
&
winInfo
.
sessionWin
,
&
key
);
tSimpleHashPut
(
pAggSup
->
pResultRows
,
&
key
,
sizeof
(
SSessionKey
),
&
winInfo
,
sizeof
(
SResultWindowInfo
));
}
}
else
{
releaseOutputBuf
(
pAggSup
->
pState
,
NULL
,
(
SResultRow
*
)
winInfo
.
pOutputBuf
,
&
pAggSup
->
stateStore
);
}
}
taosMemoryFree
(
pBuf
);
...
...
@@ -4388,7 +4399,16 @@ void streamStateReloadState(SOperatorInfo* pOperator) {
if
(
compareStateKey
(
curInfo
.
pStateKey
,
nextInfo
.
pStateKey
))
{
compactStateWindow
(
pOperator
,
&
curInfo
.
winInfo
,
&
nextInfo
.
winInfo
,
pInfo
->
pSeUpdated
,
pInfo
->
pSeUpdated
);
saveSessionOutputBuf
(
pAggSup
,
&
curInfo
.
winInfo
);
saveResult
(
curInfo
.
winInfo
,
pInfo
->
pSeUpdated
);
if
(
pInfo
->
twAggSup
.
calTrigger
==
STREAM_TRIGGER_AT_ONCE
)
{
saveResult
(
curInfo
.
winInfo
,
pInfo
->
pSeUpdated
);
}
else
if
(
pInfo
->
twAggSup
.
calTrigger
==
STREAM_TRIGGER_WINDOW_CLOSE
)
{
if
(
!
isCloseWindow
(
&
curInfo
.
winInfo
.
sessionWin
.
win
,
&
pInfo
->
twAggSup
))
{
saveDeleteRes
(
pInfo
->
pSeDeleted
,
curInfo
.
winInfo
.
sessionWin
);
}
SSessionKey
key
=
{
0
};
getSessionHashKey
(
&
curInfo
.
winInfo
.
sessionWin
,
&
key
);
tSimpleHashPut
(
pAggSup
->
pResultRows
,
&
key
,
sizeof
(
SSessionKey
),
&
curInfo
.
winInfo
,
sizeof
(
SResultWindowInfo
));
}
}
if
(
IS_VALID_SESSION_WIN
(
curInfo
.
winInfo
))
{
...
...
source/libs/stream/src/streamRecover.c
浏览文件 @
9f301bdd
...
...
@@ -62,7 +62,9 @@ const char* streamGetTaskStatusStr(int32_t status) {
static
int32_t
doLaunchScanHistoryTask
(
SStreamTask
*
pTask
)
{
SVersionRange
*
pRange
=
&
pTask
->
dataRange
.
range
;
streamSetParamForScanHistory
(
pTask
);
if
(
pTask
->
info
.
fillHistory
)
{
streamSetParamForScanHistory
(
pTask
);
}
streamSetParamForStreamScannerStep1
(
pTask
,
pRange
,
&
pTask
->
dataRange
.
window
);
int32_t
code
=
streamStartRecoverTask
(
pTask
,
0
);
...
...
@@ -80,7 +82,9 @@ int32_t streamTaskLaunchScanHistory(SStreamTask* pTask) {
walReaderGetCurrentVer
(
pTask
->
exec
.
pWalReader
));
}
}
else
if
(
pTask
->
info
.
taskLevel
==
TASK_LEVEL__AGG
)
{
streamSetParamForScanHistory
(
pTask
);
if
(
pTask
->
info
.
fillHistory
)
{
streamSetParamForScanHistory
(
pTask
);
}
streamTaskScanHistoryPrepare
(
pTask
);
}
else
if
(
pTask
->
info
.
taskLevel
==
TASK_LEVEL__SINK
)
{
qDebug
(
"s-task:%s sink task do nothing to handle scan-history"
,
pTask
->
id
.
idStr
);
...
...
@@ -434,7 +438,7 @@ int32_t streamTaskScanHistoryPrepare(SStreamTask* pTask) {
int32_t
streamAggUpstreamScanHistoryFinish
(
SStreamTask
*
pTask
)
{
void
*
exec
=
pTask
->
exec
.
pExecutor
;
if
(
qRestoreStreamOperatorOption
(
exec
)
<
0
)
{
if
(
pTask
->
info
.
fillHistory
&&
qRestoreStreamOperatorOption
(
exec
)
<
0
)
{
return
-
1
;
}
...
...
@@ -625,9 +629,12 @@ int32_t streamTaskScanHistoryDataComplete(SStreamTask* pTask) {
}
// restore param
int32_t
code
=
streamRestoreParam
(
pTask
);
if
(
code
<
0
)
{
return
-
1
;
int32_t
code
=
0
;
if
(
pTask
->
info
.
fillHistory
)
{
code
=
streamRestoreParam
(
pTask
);
if
(
code
<
0
)
{
return
-
1
;
}
}
// dispatch recover finish req to all related downstream task
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录