Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
74da3c05
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
74da3c05
编写于
4月 11, 2023
作者:
L
liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:set check point id
上级
a4ba5401
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
18 addition
and
10 deletion
+18
-10
include/libs/executor/executor.h
include/libs/executor/executor.h
+1
-1
include/libs/stream/streamState.h
include/libs/stream/streamState.h
+1
-0
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+1
-0
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+3
-2
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+4
-3
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+6
-4
source/libs/stream/src/streamState.c
source/libs/stream/src/streamState.c
+2
-0
未找到文件。
include/libs/executor/executor.h
浏览文件 @
74da3c05
...
...
@@ -92,7 +92,7 @@ void qSetTaskId(qTaskInfo_t tinfo, uint64_t taskId, uint64_t queryId);
int32_t
qSetStreamOpOpen
(
qTaskInfo_t
tinfo
);
// todo refactor
int64_t
qGetCheckpointVersion
(
qTaskInfo_t
tinfo
);
void
qGetCheckpointVersion
(
qTaskInfo_t
tinfo
,
int64_t
*
dataVer
,
int64_t
*
ckId
);
/**
* Set multiple input data blocks for the stream scan.
...
...
include/libs/stream/streamState.h
浏览文件 @
74da3c05
...
...
@@ -42,6 +42,7 @@ typedef struct STdbState {
typedef
struct
{
STdbState
*
pTdbState
;
int32_t
number
;
int64_t
checkPointId
;
}
SStreamState
;
SStreamState
*
streamStateOpen
(
char
*
path
,
struct
SStreamTask
*
pTask
,
bool
specPath
,
int32_t
szPage
,
int32_t
pages
);
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
74da3c05
...
...
@@ -140,6 +140,7 @@ typedef struct {
int64_t
fillHistoryVer2
;
SStreamState
*
pState
;
int64_t
dataVersion
;
int64_t
checkPointId
;
}
SStreamTaskInfo
;
typedef
struct
{
...
...
source/libs/executor/src/executor.c
浏览文件 @
74da3c05
...
...
@@ -198,9 +198,10 @@ int32_t qSetStreamOpOpen(qTaskInfo_t tinfo) {
return
code
;
}
int64_t
qGetCheckpointVersion
(
qTaskInfo_t
tinfo
)
{
void
qGetCheckpointVersion
(
qTaskInfo_t
tinfo
,
int64_t
*
dataVer
,
int64_t
*
ckId
)
{
SExecTaskInfo
*
pTaskInfo
=
tinfo
;
return
pTaskInfo
->
streamInfo
.
dataVersion
;
*
dataVer
=
pTaskInfo
->
streamInfo
.
dataVersion
;
*
ckId
=
pTaskInfo
->
streamInfo
.
checkPointId
;
}
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
74da3c05
...
...
@@ -2333,8 +2333,9 @@ static int32_t getNextQualifiedFinalWindow(SInterval* pInterval, STimeWindow* pN
return
startPos
;
}
static
void
setStreamDataVersion
(
SExecTaskInfo
*
pTaskInfo
,
int64_t
version
)
{
static
void
setStreamDataVersion
(
SExecTaskInfo
*
pTaskInfo
,
int64_t
version
,
int64_t
ckId
)
{
pTaskInfo
->
streamInfo
.
dataVersion
=
version
;
pTaskInfo
->
streamInfo
.
checkPointId
=
ckId
;
}
static
void
doStreamIntervalAggImpl
(
SOperatorInfo
*
pOperatorInfo
,
SSDataBlock
*
pSDataBlock
,
uint64_t
groupId
,
...
...
@@ -2506,7 +2507,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
clearFunctionContext
(
&
pOperator
->
exprSupp
);
// semi interval operator clear disk buffer
clearStreamIntervalOperator
(
pInfo
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
pState
->
checkPointId
);
qDebug
(
"===stream===clear semi operator"
);
}
else
{
deleteIntervalDiscBuf
(
pInfo
->
pState
,
pInfo
->
pPullDataMap
,
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
deleteMark
,
...
...
@@ -4762,7 +4763,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
&
pInfo
->
delKey
);
setOperatorCompleted
(
pOperator
);
streamStateCommit
(
pTaskInfo
->
streamInfo
.
pState
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
pState
->
checkPointId
);
return
NULL
;
}
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
74da3c05
...
...
@@ -285,10 +285,12 @@ int32_t streamExecForAll(SStreamTask* pTask) {
streamTaskExecImpl
(
pTask
,
pInput
,
pRes
);
int64_t
ckVer
=
qGetCheckpointVersion
(
pTask
->
exec
.
pExecutor
);
if
(
ckVer
>
pTask
->
startVer
)
{
// save it since the checkpoint is updated
qDebug
(
"s-task:%s exec end, checkpoint ver from %"
PRId64
" to %"
PRId64
,
pTask
->
id
.
idStr
,
pTask
->
startVer
,
ckVer
);
pTask
->
startVer
=
ckVer
;
int64_t
ckId
=
0
;
int64_t
dataVer
=
0
;
qGetCheckpointVersion
(
pTask
->
exec
.
pExecutor
,
&
dataVer
,
&
ckId
);
if
(
dataVer
>
pTask
->
startVer
)
{
// save it since the checkpoint is updated
qDebug
(
"s-task:%s exec end, checkpoint ver from %"
PRId64
" to %"
PRId64
,
pTask
->
id
.
idStr
,
pTask
->
startVer
,
dataVer
);
pTask
->
startVer
=
dataVer
;
streamMetaSaveTask
(
pTask
->
pMeta
,
pTask
);
if
(
streamMetaCommit
(
pTask
->
pMeta
)
<
0
)
{
...
...
source/libs/stream/src/streamState.c
浏览文件 @
74da3c05
...
...
@@ -193,6 +193,7 @@ SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath, int
}
pState
->
pTdbState
->
pOwner
=
pTask
;
pState
->
checkPointId
=
0
;
return
pState
;
...
...
@@ -243,6 +244,7 @@ int32_t streamStateCommit(SStreamState* pState) {
TDB_TXN_WRITE
|
TDB_TXN_READ_UNCOMMITTED
)
<
0
)
{
return
-
1
;
}
pState
->
checkPointId
++
;
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录