Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2c4b44b5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
2c4b44b5
编写于
5月 09, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: merge data of mem and file
上级
6916f469
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
9 deletion
+18
-9
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+18
-9
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
2c4b44b5
...
...
@@ -1985,7 +1985,7 @@ static void doMergeTwoLevelData(STsdbReadHandle* pTsdbReadHandle, STableCheckInf
return
;
}
else
if
(
pCheckInfo
->
iter
!=
NULL
||
pCheckInfo
->
iiter
!=
NULL
)
{
SSkipListNode
*
node
=
NULL
;
TSKEY
last
RowKey
=
TSKEY_INITIAL_VAL
;
TSKEY
last
KeyAppend
=
TSKEY_INITIAL_VAL
;
do
{
STSRow
*
row2
=
NULL
;
...
...
@@ -2019,8 +2019,8 @@ static void doMergeTwoLevelData(STsdbReadHandle* pTsdbReadHandle, STableCheckInf
}
numOfRows
+=
mergeTwoRowFromMem
(
pTsdbReadHandle
,
pTsdbReadHandle
->
outputCapacity
,
&
curRow
,
row1
,
row2
,
numOfCols
,
pCheckInfo
->
tableId
,
pSchema1
,
pSchema2
,
pCfg
->
update
,
&
last
RowKey
);
// numOfRows += 1;
pCheckInfo
->
tableId
,
pSchema1
,
pSchema2
,
pCfg
->
update
,
&
last
KeyAppend
);
if
(
cur
->
win
.
skey
==
TSKEY_INITIAL_VAL
)
{
cur
->
win
.
skey
=
key
;
}
...
...
@@ -2028,7 +2028,6 @@ static void doMergeTwoLevelData(STsdbReadHandle* pTsdbReadHandle, STableCheckInf
cur
->
win
.
ekey
=
key
;
cur
->
lastKey
=
key
+
step
;
cur
->
mixBlock
=
true
;
moveToNextRowInMem
(
pCheckInfo
);
}
else
if
(
key
==
tsArray
[
pos
])
{
// data in buffer has the same timestamp of data in file block, ignore it
#if 0
...
...
@@ -2064,7 +2063,11 @@ static void doMergeTwoLevelData(STsdbReadHandle* pTsdbReadHandle, STableCheckInf
}
#endif
if
(
TD_SUPPORT_UPDATE
(
pCfg
->
update
))
{
doCopyRowsFromFileBlock
(
pTsdbReadHandle
,
pTsdbReadHandle
->
outputCapacity
,
curRow
,
pos
,
pos
);
if
(
lastKeyAppend
!=
key
)
{
lastKeyAppend
=
key
;
++
curRow
;
}
numOfRows
=
doCopyRowsFromFileBlock
(
pTsdbReadHandle
,
pTsdbReadHandle
->
outputCapacity
,
curRow
,
pos
,
pos
);
if
(
rv1
!=
TD_ROW_SVER
(
row1
))
{
// pSchema1 = tsdbGetTableSchemaByVersion(pTable, memRowVersion(row1));
...
...
@@ -2074,10 +2077,8 @@ static void doMergeTwoLevelData(STsdbReadHandle* pTsdbReadHandle, STableCheckInf
// pSchema2 = tsdbGetTableSchemaByVersion(pTable, memRowVersion(row2));
rv2
=
TD_ROW_SVER
(
row2
);
}
numOfRows
+=
mergeTwoRowFromMem
(
pTsdbReadHandle
,
pTsdbReadHandle
->
outputCapacity
,
&
curRow
,
row1
,
row2
,
numOfCols
,
pCheckInfo
->
tableId
,
pSchema1
,
pSchema2
,
pCfg
->
update
,
&
lastRowKey
);
// ++numOfRows;
pCheckInfo
->
tableId
,
pSchema1
,
pSchema2
,
pCfg
->
update
,
&
lastKeyAppend
);
if
(
cur
->
win
.
skey
==
TSKEY_INITIAL_VAL
)
{
cur
->
win
.
skey
=
key
;
}
...
...
@@ -2118,11 +2119,19 @@ static void doMergeTwoLevelData(STsdbReadHandle* pTsdbReadHandle, STableCheckInf
int32_t
qstart
=
0
,
qend
=
0
;
getQualifiedRowsPos
(
pTsdbReadHandle
,
pos
,
end
,
numOfRows
,
&
qstart
,
&
qend
);
numOfRows
=
doCopyRowsFromFileBlock
(
pTsdbReadHandle
,
pTsdbReadHandle
->
outputCapacity
,
numOfRows
,
qstart
,
qend
);
if
((
lastKeyAppend
!=
TSKEY_INITIAL_VAL
)
&&
(
lastKeyAppend
!=
(
ASCENDING_TRAVERSE
(
pTsdbReadHandle
->
order
)
?
tsArray
[
qstart
]
:
tsArray
[
qend
])))
{
++
curRow
;
}
numOfRows
=
doCopyRowsFromFileBlock
(
pTsdbReadHandle
,
pTsdbReadHandle
->
outputCapacity
,
curRow
,
qstart
,
qend
);
pos
+=
(
qend
-
qstart
+
1
)
*
step
;
if
(
numOfRows
>
0
)
{
curRow
=
numOfRows
-
1
;
}
cur
->
win
.
ekey
=
ASCENDING_TRAVERSE
(
pTsdbReadHandle
->
order
)
?
tsArray
[
qend
]
:
tsArray
[
qstart
];
cur
->
lastKey
=
cur
->
win
.
ekey
+
step
;
lastKeyAppend
=
cur
->
win
.
ekey
;
}
}
while
(
numOfRows
<
pTsdbReadHandle
->
outputCapacity
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录