Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
24e039ef
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看板
未验证
提交
24e039ef
编写于
3月 09, 2023
作者:
H
Haojun Liao
提交者:
GitHub
3月 09, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20344 from taosdata/fix/ly_stream
fix:fill history check update
上级
8b2dc48c
87ba6cb0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
13 deletion
+40
-13
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+2
-2
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+2
-1
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+35
-8
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+1
-2
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
24e039ef
...
...
@@ -2044,8 +2044,8 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf)
if
(
len
>=
size
-
1
)
return
dumpBuf
;
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
// len += snprintf(dumpBuf + len, size - len, " %15l
f |", *(double*)var);
//
if (len >= size - 1) return dumpBuf;
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
" %15
f |"
,
*
(
double
*
)
var
);
if
(
len
>=
size
-
1
)
return
dumpBuf
;
break
;
case
TSDB_DATA_TYPE_BOOL
:
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
" %15d |"
,
*
(
bool
*
)
var
);
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
24e039ef
...
...
@@ -121,7 +121,8 @@ enum {
STREAM_RECOVER_STEP__NONE
=
0
,
STREAM_RECOVER_STEP__PREPARE1
,
STREAM_RECOVER_STEP__PREPARE2
,
STREAM_RECOVER_STEP__SCAN
,
STREAM_RECOVER_STEP__SCAN1
,
STREAM_RECOVER_STEP__SCAN2
,
};
typedef
struct
{
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
24e039ef
...
...
@@ -1724,9 +1724,9 @@ static void setBlockGroupIdByUid(SStreamScanInfo* pInfo, SSDataBlock* pBlock) {
}
}
static
void
doCheckUpdate
(
SStreamScanInfo
*
pInfo
,
TSKEY
endKey
)
{
static
void
doCheckUpdate
(
SStreamScanInfo
*
pInfo
,
TSKEY
endKey
,
SSDataBlock
*
pBlock
)
{
if
(
pInfo
->
pUpdateInfo
)
{
checkUpdateData
(
pInfo
,
true
,
p
Info
->
pRes
,
true
);
checkUpdateData
(
pInfo
,
true
,
p
Block
,
true
);
pInfo
->
twAggSup
.
maxTs
=
TMAX
(
pInfo
->
twAggSup
.
maxTs
,
endKey
);
if
(
pInfo
->
pUpdateDataRes
->
info
.
rows
>
0
)
{
pInfo
->
updateResIndex
=
0
;
...
...
@@ -1758,11 +1758,13 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
pTSInfo
->
base
.
cond
.
endVersion
=
pTaskInfo
->
streamInfo
.
fillHistoryVer1
;
qDebug
(
"stream recover step 1, from %"
PRId64
" to %"
PRId64
,
pTSInfo
->
base
.
cond
.
startVersion
,
pTSInfo
->
base
.
cond
.
endVersion
);
pTaskInfo
->
streamInfo
.
recoverStep
=
STREAM_RECOVER_STEP__SCAN1
;
}
else
{
pTSInfo
->
base
.
cond
.
startVersion
=
pTaskInfo
->
streamInfo
.
fillHistoryVer1
+
1
;
pTSInfo
->
base
.
cond
.
endVersion
=
pTaskInfo
->
streamInfo
.
fillHistoryVer2
;
qDebug
(
"stream recover step 2, from %"
PRId64
" to %"
PRId64
,
pTSInfo
->
base
.
cond
.
startVersion
,
pTSInfo
->
base
.
cond
.
endVersion
);
pTaskInfo
->
streamInfo
.
recoverStep
=
STREAM_RECOVER_STEP__SCAN2
;
}
/*resetTableScanInfo(pTSInfo, pWin);*/
...
...
@@ -1772,11 +1774,11 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
pTSInfo
->
scanTimes
=
0
;
pTSInfo
->
currentGroupId
=
-
1
;
pTaskInfo
->
streamInfo
.
recoverStep
=
STREAM_RECOVER_STEP__SCAN
;
pTaskInfo
->
streamInfo
.
recoverScanFinished
=
false
;
}
if
(
pTaskInfo
->
streamInfo
.
recoverStep
==
STREAM_RECOVER_STEP__SCAN
)
{
if
(
pTaskInfo
->
streamInfo
.
recoverStep
==
STREAM_RECOVER_STEP__SCAN1
||
pTaskInfo
->
streamInfo
.
recoverStep
==
STREAM_RECOVER_STEP__SCAN2
)
{
if
(
pInfo
->
blockRecoverContiCnt
>
100
)
{
pInfo
->
blockRecoverTotCnt
+=
pInfo
->
blockRecoverContiCnt
;
pInfo
->
blockRecoverContiCnt
=
0
;
...
...
@@ -1789,6 +1791,27 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
printDataBlock
(
pInfo
->
pRecoverRes
,
"scan recover"
);
return
pInfo
->
pRecoverRes
;
}
break
;
case
STREAM_SCAN_FROM_UPDATERES
:
{
generateScanRange
(
pInfo
,
pInfo
->
pUpdateDataRes
,
pInfo
->
pUpdateRes
);
prepareRangeScan
(
pInfo
,
pInfo
->
pUpdateRes
,
&
pInfo
->
updateResIndex
);
pInfo
->
scanMode
=
STREAM_SCAN_FROM_DATAREADER_RANGE
;
return
pInfo
->
pUpdateRes
;
}
break
;
case
STREAM_SCAN_FROM_DATAREADER_RANGE
:
{
SSDataBlock
*
pSDB
=
doRangeScan
(
pInfo
,
pInfo
->
pUpdateRes
,
pInfo
->
primaryTsIndex
,
&
pInfo
->
updateResIndex
);
if
(
pSDB
)
{
STableScanInfo
*
pTableScanInfo
=
pInfo
->
pTableScanOp
->
info
;
uint64_t
version
=
getReaderMaxVersion
(
pTableScanInfo
->
base
.
dataReader
);
updateInfoSetScanRange
(
pInfo
->
pUpdateInfo
,
&
pTableScanInfo
->
base
.
cond
.
twindows
,
pInfo
->
groupId
,
version
);
pSDB
->
info
.
type
=
pInfo
->
scanMode
==
STREAM_SCAN_FROM_DATAREADER_RANGE
?
STREAM_NORMAL
:
STREAM_PULL_DATA
;
checkUpdateData
(
pInfo
,
true
,
pSDB
,
false
);
// printDataBlock(pSDB, "stream scan update");
calBlockTbName
(
pInfo
,
pSDB
);
return
pSDB
;
}
blockDataCleanup
(
pInfo
->
pUpdateDataRes
);
pInfo
->
scanMode
=
STREAM_SCAN_FROM_READERHANDLE
;
}
break
;
default:
break
;
}
...
...
@@ -1798,8 +1821,12 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
pInfo
->
blockRecoverContiCnt
++
;
calBlockTbName
(
pInfo
,
pInfo
->
pRecoverRes
);
if
(
pInfo
->
pUpdateInfo
)
{
TSKEY
maxTs
=
updateInfoFillBlockData
(
pInfo
->
pUpdateInfo
,
pInfo
->
pRecoverRes
,
pInfo
->
primaryTsIndex
);
pInfo
->
twAggSup
.
maxTs
=
TMAX
(
pInfo
->
twAggSup
.
maxTs
,
maxTs
);
if
(
pTaskInfo
->
streamInfo
.
recoverStep
==
STREAM_RECOVER_STEP__SCAN1
)
{
TSKEY
maxTs
=
updateInfoFillBlockData
(
pInfo
->
pUpdateInfo
,
pInfo
->
pRecoverRes
,
pInfo
->
primaryTsIndex
);
pInfo
->
twAggSup
.
maxTs
=
TMAX
(
pInfo
->
twAggSup
.
maxTs
,
maxTs
);
}
else
{
doCheckUpdate
(
pInfo
,
pInfo
->
pRecoverRes
->
info
.
window
.
ekey
,
pInfo
->
pRecoverRes
);
}
}
if
(
pInfo
->
pCreateTbRes
->
info
.
rows
>
0
)
{
pInfo
->
scanMode
=
STREAM_SCAN_FROM_RES
;
...
...
@@ -1910,7 +1937,7 @@ FETCH_NEXT_BLOCK:
switch
(
pInfo
->
scanMode
)
{
case
STREAM_SCAN_FROM_RES
:
{
pInfo
->
scanMode
=
STREAM_SCAN_FROM_READERHANDLE
;
doCheckUpdate
(
pInfo
,
pInfo
->
pRes
->
info
.
window
.
ekey
);
doCheckUpdate
(
pInfo
,
pInfo
->
pRes
->
info
.
window
.
ekey
,
pInfo
->
pRes
);
doFilter
(
pInfo
->
pRes
,
pOperator
->
exprSupp
.
pFilterInfo
,
NULL
);
pInfo
->
pRes
->
info
.
dataLoad
=
1
;
blockDataUpdateTsWindow
(
pInfo
->
pRes
,
pInfo
->
primaryTsIndex
);
...
...
@@ -2011,7 +2038,7 @@ FETCH_NEXT_BLOCK:
return
pInfo
->
pCreateTbRes
;
}
doCheckUpdate
(
pInfo
,
pBlockInfo
->
window
.
ekey
);
doCheckUpdate
(
pInfo
,
pBlockInfo
->
window
.
ekey
,
pInfo
->
pRes
);
doFilter
(
pInfo
->
pRes
,
pOperator
->
exprSupp
.
pFilterInfo
,
NULL
);
pInfo
->
pRes
->
info
.
dataLoad
=
1
;
blockDataUpdateTsWindow
(
pInfo
->
pRes
,
pInfo
->
primaryTsIndex
);
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
24e039ef
...
...
@@ -4805,10 +4805,9 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
setInverFunction
(
pSup
->
pCtx
,
pOperator
->
exprSupp
.
numOfExprs
,
pBlock
->
info
.
type
);
}
doStreamIntervalAggImpl
(
pOperator
,
pBlock
,
pBlock
->
info
.
id
.
groupId
,
pInfo
->
pUpdatedMap
);
pInfo
->
twAggSup
.
maxTs
=
TMAX
(
pInfo
->
twAggSup
.
maxTs
,
pBlock
->
info
.
window
.
ekey
);
pInfo
->
twAggSup
.
minTs
=
TMIN
(
pInfo
->
twAggSup
.
minTs
,
pBlock
->
info
.
window
.
skey
);
doStreamIntervalAggImpl
(
pOperator
,
pBlock
,
pBlock
->
info
.
id
.
groupId
,
pInfo
->
pUpdatedMap
);
}
pOperator
->
status
=
OP_RES_TO_RETURN
;
removeDeleteResults
(
pInfo
->
pUpdatedMap
,
pInfo
->
pDelWins
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录