Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
49728a23
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看板
提交
49728a23
编写于
4月 25, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: more fix
上级
d57676c9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
35 deletion
+57
-35
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+3
-2
source/dnode/vnode/src/tsdb/tsdbDataIter.c
source/dnode/vnode/src/tsdb/tsdbDataIter.c
+39
-22
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
+15
-11
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
49728a23
...
...
@@ -322,8 +322,9 @@ int32_t tGnrtDiskData(SDiskDataBuilder *pBuilder, const SDiskData **ppDiskData,
#define TSDB_STT_FILE_DATA_ITER 2
#define TSDB_TOMB_FILE_DATA_ITER 3
#define TSDB_FILTER_FLAG_BY_VERSION 0x1
#define TSDB_FILTER_FLAG_BY_TABLEID 0x2
#define TSDB_FILTER_FLAG_BY_VERSION 0x1
#define TSDB_FILTER_FLAG_BY_TABLEID 0x2
#define TSDB_FILTER_FLAG_IGNORE_DROPPED_TABLE 0x4
#define TSDB_RBTN_TO_DATA_ITER(pNode) ((STsdbDataIter2 *)(((char *)pNode) - offsetof(STsdbDataIter2, rbtn)))
/* open */
...
...
source/dnode/vnode/src/tsdb/tsdbDataIter.c
浏览文件 @
49728a23
...
...
@@ -14,6 +14,7 @@
*/
#include "tsdb.h"
#include "vnodeInt.h"
// STsdbDataIter2
/* open */
...
...
@@ -202,13 +203,6 @@ static int32_t tsdbDataFileDataIterNext(STsdbDataIter2* pIter, STsdbFilterInfo*
for
(;;)
{
while
(
pIter
->
dIter
.
iRow
<
pIter
->
dIter
.
bData
.
nRow
)
{
if
(
pFilterInfo
)
{
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_BY_TABLEID
)
{
if
(
pFilterInfo
->
tbid
.
uid
==
pIter
->
dIter
.
bData
.
uid
)
{
pIter
->
dIter
.
iRow
=
pIter
->
dIter
.
bData
.
nRow
;
continue
;
}
}
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_BY_VERSION
)
{
if
(
pIter
->
dIter
.
bData
.
aVersion
[
pIter
->
dIter
.
iRow
]
<
pFilterInfo
->
sver
||
pIter
->
dIter
.
bData
.
aVersion
[
pIter
->
dIter
.
iRow
]
>
pFilterInfo
->
ever
)
{
...
...
@@ -232,13 +226,6 @@ static int32_t tsdbDataFileDataIterNext(STsdbDataIter2* pIter, STsdbFilterInfo*
// filter
if
(
pFilterInfo
)
{
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_BY_TABLEID
)
{
if
(
tTABLEIDCmprFn
(
&
pFilterInfo
->
tbid
,
&
pIter
->
rowInfo
)
==
0
)
{
pIter
->
dIter
.
iDataBlk
=
pIter
->
dIter
.
mDataBlk
.
nItem
;
continue
;
}
}
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_BY_VERSION
)
{
if
(
pFilterInfo
->
sver
>
dataBlk
.
maxVer
||
pFilterInfo
->
ever
<
dataBlk
.
minVer
)
{
pIter
->
dIter
.
iDataBlk
++
;
...
...
@@ -262,13 +249,23 @@ static int32_t tsdbDataFileDataIterNext(STsdbDataIter2* pIter, STsdbFilterInfo*
if
(
pIter
->
dIter
.
iBlockIdx
<
taosArrayGetSize
(
pIter
->
dIter
.
aBlockIdx
))
{
SBlockIdx
*
pBlockIdx
=
taosArrayGet
(
pIter
->
dIter
.
aBlockIdx
,
pIter
->
dIter
.
iBlockIdx
);
if
(
pFilterInfo
&&
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_BY_TABLEID
))
{
int32_t
c
=
tTABLEIDCmprFn
(
pBlockIdx
,
&
pFilterInfo
->
tbid
);
if
(
c
==
0
)
{
pIter
->
dIter
.
iBlockIdx
++
;
continue
;
}
else
if
(
c
<
0
)
{
ASSERT
(
0
);
if
(
pFilterInfo
)
{
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_BY_TABLEID
)
{
int32_t
c
=
tTABLEIDCmprFn
(
pBlockIdx
,
&
pFilterInfo
->
tbid
);
if
(
c
==
0
)
{
pIter
->
dIter
.
iBlockIdx
++
;
continue
;
}
else
if
(
c
<
0
)
{
ASSERT
(
0
);
}
}
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_IGNORE_DROPPED_TABLE
)
{
SMetaInfo
info
;
if
(
metaGetInfo
(
pIter
->
dIter
.
pReader
->
pTsdb
->
pVnode
->
pMeta
,
pBlockIdx
->
uid
,
&
info
,
NULL
))
{
pIter
->
dIter
.
iBlockIdx
++
;
continue
;
}
}
}
...
...
@@ -304,14 +301,24 @@ static int32_t tsdbSttFileDataIterNext(STsdbDataIter2* pIter, STsdbFilterInfo* p
for
(;;)
{
while
(
pIter
->
sIter
.
iRow
<
pIter
->
sIter
.
bData
.
nRow
)
{
if
(
pFilterInfo
)
{
int64_t
uid
=
pIter
->
sIter
.
bData
.
uid
?
pIter
->
sIter
.
bData
.
uid
:
pIter
->
sIter
.
bData
.
aUid
[
pIter
->
sIter
.
iRow
];
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_BY_TABLEID
)
{
int64_t
uid
=
pIter
->
sIter
.
bData
.
uid
?
pIter
->
sIter
.
bData
.
uid
:
pIter
->
sIter
.
bData
.
aUid
[
pIter
->
sIter
.
iRow
];
if
(
pFilterInfo
->
tbid
.
uid
==
uid
)
{
pIter
->
sIter
.
iRow
++
;
continue
;
}
}
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_IGNORE_DROPPED_TABLE
)
{
if
(
pIter
->
rowInfo
.
uid
!=
uid
)
{
SMetaInfo
info
;
if
(
metaGetInfo
(
pIter
->
sIter
.
pReader
->
pTsdb
->
pVnode
->
pMeta
,
uid
,
&
info
,
NULL
))
{
pIter
->
sIter
.
iRow
++
;
continue
;
}
}
}
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_BY_VERSION
)
{
if
(
pFilterInfo
->
sver
>
pIter
->
sIter
.
bData
.
aVersion
[
pIter
->
sIter
.
iRow
]
||
pFilterInfo
->
ever
<
pIter
->
sIter
.
bData
.
aVersion
[
pIter
->
sIter
.
iRow
])
{
...
...
@@ -395,6 +402,16 @@ static int32_t tsdbTombFileDataIterNext(STsdbDataIter2* pIter, STsdbFilterInfo*
if
(
pIter
->
tIter
.
iDelIdx
<
taosArrayGetSize
(
pIter
->
tIter
.
aDelIdx
))
{
SDelIdx
*
pDelIdx
=
taosArrayGet
(
pIter
->
tIter
.
aDelIdx
,
pIter
->
tIter
.
iDelIdx
);
if
(
pFilterInfo
)
{
if
(
pFilterInfo
->
flag
&
TSDB_FILTER_FLAG_IGNORE_DROPPED_TABLE
)
{
SMetaInfo
info
;
if
(
metaGetInfo
(
pIter
->
dIter
.
pReader
->
pTsdb
->
pVnode
->
pMeta
,
pDelIdx
->
uid
,
&
info
,
NULL
))
{
pIter
->
tIter
.
iDelIdx
++
;
continue
;
}
}
}
code
=
tsdbReadDelData
(
pIter
->
tIter
.
pReader
,
pDelIdx
,
pIter
->
tIter
.
aDelData
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
...
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
浏览文件 @
49728a23
...
...
@@ -70,10 +70,11 @@ static int32_t tsdbSnapReadFileDataStart(STsdbSnapReader* pReader) {
if
(
pReader
->
pIter
)
{
// iter to next with filter info (sver, ever)
code
=
tsdbDataIterNext2
(
pReader
->
pIter
,
&
(
STsdbFilterInfo
){.
flag
=
TSDB_FILTER_FLAG_BY_VERSION
,
// flag
.
sver
=
pReader
->
sver
,
.
ever
=
pReader
->
ever
});
code
=
tsdbDataIterNext2
(
pReader
->
pIter
,
&
(
STsdbFilterInfo
){.
flag
=
TSDB_FILTER_FLAG_BY_VERSION
|
TSDB_FILTER_FLAG_IGNORE_DROPPED_TABLE
,
// flag
.
sver
=
pReader
->
sver
,
.
ever
=
pReader
->
ever
});
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
if
(
pReader
->
pIter
->
rowInfo
.
suid
||
pReader
->
pIter
->
rowInfo
.
uid
)
{
...
...
@@ -94,10 +95,11 @@ static int32_t tsdbSnapReadFileDataStart(STsdbSnapReader* pReader) {
if
(
pReader
->
pIter
)
{
// iter to valid row
code
=
tsdbDataIterNext2
(
pReader
->
pIter
,
&
(
STsdbFilterInfo
){.
flag
=
TSDB_FILTER_FLAG_BY_VERSION
,
// flag
.
sver
=
pReader
->
sver
,
.
ever
=
pReader
->
ever
});
code
=
tsdbDataIterNext2
(
pReader
->
pIter
,
&
(
STsdbFilterInfo
){.
flag
=
TSDB_FILTER_FLAG_BY_VERSION
|
TSDB_FILTER_FLAG_IGNORE_DROPPED_TABLE
,
// flag
.
sver
=
pReader
->
sver
,
.
ever
=
pReader
->
ever
});
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
if
(
pReader
->
pIter
->
rowInfo
.
suid
||
pReader
->
pIter
->
rowInfo
.
uid
)
{
...
...
@@ -139,7 +141,8 @@ static int32_t tsdbSnapReadNextRow(STsdbSnapReader* pReader, SRowInfo** ppRowInf
int32_t
lino
=
0
;
if
(
pReader
->
pIter
)
{
code
=
tsdbDataIterNext2
(
pReader
->
pIter
,
&
(
STsdbFilterInfo
){.
flag
=
TSDB_FILTER_FLAG_BY_VERSION
,
// flag
code
=
tsdbDataIterNext2
(
pReader
->
pIter
,
&
(
STsdbFilterInfo
){.
flag
=
TSDB_FILTER_FLAG_BY_VERSION
|
TSDB_FILTER_FLAG_IGNORE_DROPPED_TABLE
,
// flag
.
sver
=
pReader
->
sver
,
.
ever
=
pReader
->
ever
});
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
...
@@ -346,8 +349,9 @@ static int32_t tsdbSnapReadNextTombData(STsdbSnapReader* pReader, SDelInfo** ppD
int32_t
lino
=
0
;
code
=
tsdbDataIterNext2
(
pReader
->
pTIter
,
&
(
STsdbFilterInfo
){.
flag
=
TSDB_FILTER_FLAG_BY_VERSION
,
.
sver
=
pReader
->
sver
,
.
ever
=
pReader
->
ever
});
pReader
->
pTIter
,
&
(
STsdbFilterInfo
){.
flag
=
TSDB_FILTER_FLAG_BY_VERSION
|
TSDB_FILTER_FLAG_IGNORE_DROPPED_TABLE
,
.
sver
=
pReader
->
sver
,
.
ever
=
pReader
->
ever
});
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
if
(
ppDelInfo
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录