Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ba4d726a
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看板
提交
ba4d726a
编写于
7月 09, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tsdb): fix error in tsdbread.
上级
b39198a5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
77 deletion
+8
-77
source/dnode/vnode/src/tsdb/tsdbRead2.c
source/dnode/vnode/src/tsdb/tsdbRead2.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbReadUtil.c
source/dnode/vnode/src/tsdb/tsdbReadUtil.c
+7
-75
source/dnode/vnode/src/tsdb/tsdbReadUtil.h
source/dnode/vnode/src/tsdb/tsdbReadUtil.h
+0
-1
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead2.c
浏览文件 @
ba4d726a
...
...
@@ -545,7 +545,7 @@ static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SBlockN
}
if
(
uid
<
pRecord
->
uid
)
{
// forward the table uid index
while
(
pReader
->
status
.
uidList
.
tableUidList
[
k
]
<
pRecord
->
uid
&&
k
<
numOfTables
)
{
while
(
k
<
numOfTables
&&
pReader
->
status
.
uidList
.
tableUidList
[
k
]
<
pRecord
->
uid
)
{
k
+=
1
;
}
...
...
source/dnode/vnode/src/tsdb/tsdbReadUtil.c
浏览文件 @
ba4d726a
...
...
@@ -453,48 +453,8 @@ bool blockIteratorNext(SDataBlockIter* pBlockIter, const char* idStr) {
}
// load tomb data API
//static int32_t checkTombBlockRecords(SArray* pData, STombBlock* pBlock, uint64_t suid, uint64_t uid, int64_t maxVer);
//int32_t loadSttTombData(SArray* pLDataIterList, uint64_t suid, STableBlockScanInfo* pScanInfo, uint64_t maxVer) {
// int32_t size = taosArrayGetSize(pLDataIterList);
// if (size <= 0) {
// return TSDB_CODE_SUCCESS;
// }
//
// uint64_t uid = pScanInfo->uid;
// if (pScanInfo->pfileDelData == NULL) {
// pScanInfo->pfileDelData = taosArrayInit(4, sizeof(SDelData));
// }
//
// for (int32_t i = 0; i < size; ++i) {
// SArray* pLeveledLDataIter = taosArrayGetP(pLDataIterList, i);
//
// int32_t numOfIter = taosArrayGetSize(pLeveledLDataIter);
// if (numOfIter == 0) {
// continue;
// }
//
// for (int32_t f = 0; f < numOfIter; ++f) {
// SLDataIter* pIter = taosArrayGetP(pLeveledLDataIter, f);
//
// SArray* pTombBlockArray = pIter->pBlockLoadInfo->pTombBlockArray;
// int32_t numOfBlocks = taosArrayGetSize(pTombBlockArray);
// for (int32_t k = 0; k < numOfBlocks; ++k) {
// STombBlock* pBlock = taosArrayGetP(pTombBlockArray, k);
//
// int32_t code = checkTombBlockRecords(pScanInfo->pfileDelData, pBlock, suid, uid, maxVer);
// if (code != TSDB_CODE_SUCCESS) {
// return code;
// }
// }
// }
// }
//
// return TSDB_CODE_SUCCESS;
//}
int32_t
doLoadTombDataFromTombBlk
(
const
TTombBlkArray
*
pTombBlkArray
,
STsdbReader
*
pReader
,
SDataFileReader
*
pFileReader
,
SSttFileReader
*
pSttReader
,
bool
isFile
)
{
static
int32_t
doLoadTombDataFromTombBlk
(
const
TTombBlkArray
*
pTombBlkArray
,
STsdbReader
*
pReader
,
void
*
pFileReader
,
bool
isFile
)
{
int32_t
code
=
0
;
STableUidList
*
pList
=
&
pReader
->
status
.
uidList
;
...
...
@@ -524,7 +484,7 @@ int32_t doLoadTombDataFromTombBlk(const TTombBlkArray* pTombBlkArray, STsdbReade
STombBlock
block
=
{
0
};
code
=
isFile
?
tsdbDataFileReadTombBlock
(
pFileReader
,
&
pTombBlkArray
->
data
[
i
],
&
block
)
:
tsdbSttFileReadTombBlock
(
p
Stt
Reader
,
&
pTombBlkArray
->
data
[
i
],
&
block
);
:
tsdbSttFileReadTombBlock
(
p
File
Reader
,
&
pTombBlkArray
->
data
[
i
],
&
block
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -540,6 +500,7 @@ int32_t doLoadTombDataFromTombBlk(const TTombBlkArray* pTombBlkArray, STsdbReade
for
(
int32_t
k
=
0
;
k
<
TARRAY2_SIZE
(
block
.
suid
);
++
k
)
{
code
=
tTombBlockGet
(
&
block
,
k
,
&
record
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tTombBlockDestroy
(
&
block
);
return
code
;
}
...
...
@@ -554,7 +515,7 @@ int32_t doLoadTombDataFromTombBlk(const TTombBlkArray* pTombBlkArray, STsdbReade
bool
newTable
=
false
;
if
(
uid
<
record
.
uid
)
{
while
(
pReader
->
status
.
uidList
.
tableUidList
[
j
]
<
record
.
uid
&&
j
<
numOfTables
)
{
while
(
j
<
numOfTables
&&
pReader
->
status
.
uidList
.
tableUidList
[
j
]
<
record
.
uid
)
{
j
+=
1
;
newTable
=
true
;
}
...
...
@@ -605,7 +566,7 @@ int32_t loadDataFileTombDataForAll(STsdbReader* pReader) {
return
code
;
}
return
doLoadTombDataFromTombBlk
(
pBlkArray
,
pReader
,
pReader
->
pFileReader
,
NULL
,
true
);
return
doLoadTombDataFromTombBlk
(
pBlkArray
,
pReader
,
pReader
->
pFileReader
,
true
);
}
int32_t
loadSttTombDataForAll
(
STsdbReader
*
pReader
,
SSttFileReader
*
pSttFileReader
,
SSttBlockLoadInfo
*
pLoadInfo
)
{
...
...
@@ -619,7 +580,7 @@ int32_t loadSttTombDataForAll(STsdbReader* pReader, SSttFileReader* pSttFileRead
return
code
;
}
return
doLoadTombDataFromTombBlk
(
pBlkArray
,
pReader
,
NULL
,
pSttFileReader
,
false
);
return
doLoadTombDataFromTombBlk
(
pBlkArray
,
pReader
,
pSttFileReader
,
false
);
}
void
loadMemTombData
(
STableBlockScanInfo
*
pScanInfo
,
STbData
*
pMemTbData
,
STbData
*
piMemTbData
,
int64_t
ver
)
{
...
...
@@ -649,32 +610,3 @@ void loadMemTombData(STableBlockScanInfo* pScanInfo, STbData* pMemTbData, STbDat
}
}
}
int32_t
checkTombBlockRecords
(
SArray
*
pData
,
STombBlock
*
pBlock
,
uint64_t
suid
,
uint64_t
uid
,
int64_t
maxVer
)
{
STombRecord
record
=
{
0
};
for
(
int32_t
j
=
0
;
j
<
pBlock
->
suid
->
size
;
++
j
)
{
int32_t
code
=
tTombBlockGet
(
pBlock
,
j
,
&
record
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
if
(
record
.
suid
<
suid
)
{
continue
;
}
if
(
record
.
suid
>
suid
||
(
record
.
suid
==
suid
&&
record
.
uid
>
uid
))
{
break
;
}
if
(
record
.
uid
<
uid
)
{
continue
;
}
if
(
record
.
version
<=
maxVer
)
{
SDelData
delData
=
{.
version
=
record
.
version
,
.
sKey
=
record
.
skey
,
.
eKey
=
record
.
ekey
};
taosArrayPush
(
pData
,
&
delData
);
}
}
return
TSDB_CODE_SUCCESS
;
}
source/dnode/vnode/src/tsdb/tsdbReadUtil.h
浏览文件 @
ba4d726a
...
...
@@ -253,7 +253,6 @@ int32_t initBlockIterator(STsdbReader* pReader, SDataBlockIter* pBlockIter, int3
bool
blockIteratorNext
(
SDataBlockIter
*
pBlockIter
,
const
char
*
idStr
);
// load tomb data API (stt/mem only for one table each, tomb data from data files are load for all tables at one time)
//int32_t loadSttTombData(SArray* pLDataIterList, uint64_t suid, STableBlockScanInfo* pScanInfo, uint64_t maxVer);
void
loadMemTombData
(
STableBlockScanInfo
*
pScanInfo
,
STbData
*
pMemTbData
,
STbData
*
piMemTbData
,
int64_t
ver
);
int32_t
loadDataFileTombDataForAll
(
STsdbReader
*
pReader
);
int32_t
loadSttTombDataForAll
(
STsdbReader
*
pReader
,
SSttFileReader
*
pSttFileReader
,
SSttBlockLoadInfo
*
pLoadInfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录