Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ba38a625
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看板
提交
ba38a625
编写于
6月 29, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): remove the shared ptr between reader ptr.
上级
0df1cff3
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
34 addition
and
30 deletion
+34
-30
source/dnode/vnode/src/tsdb/tsdbRead2.c
source/dnode/vnode/src/tsdb/tsdbRead2.c
+34
-30
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead2.c
浏览文件 @
ba38a625
...
...
@@ -173,7 +173,6 @@ typedef struct SReaderStatus {
SFilesetIter
fileIter
;
SDataBlockIter
blockIter
;
SArray
*
pLDataIterArray
;
// SLDataIter* pLDataIter;
SRowMerger
merger
;
SColumnInfoData
*
pPrimaryTsCol
;
// primary time stamp output col info data
}
SReaderStatus
;
...
...
@@ -2444,7 +2443,6 @@ static int32_t mergeFileBlockAndLastBlock(STsdbReader* pReader, SLastBlockReader
// row in last file block
TSDBROW
fRow
=
tsdbRowFromBlockData
(
pBlockData
,
pDumpInfo
->
rowIndex
);
int64_t
ts
=
getCurrentKeyInLastBlock
(
pLastBlockReader
);
// ASSERT(ts >= key);
if
(
ASCENDING_TRAVERSE
(
pReader
->
order
))
{
if
(
key
<
ts
)
{
// imem, mem are all empty, file blocks (data blocks and last block) exist
...
...
@@ -2788,6 +2786,37 @@ static bool isValidFileBlockRow(SBlockData* pBlockData, SFileBlockDumpInfo* pDum
return
true
;
}
static
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
;
}
// todo use binary search instead here
if
(
record
.
uid
<
uid
)
{
continue
;
}
if
(
record
.
uid
>
uid
)
{
break
;
}
if
(
record
.
version
<=
maxVer
)
{
SDelData
delData
=
{.
version
=
record
.
version
,
.
sKey
=
record
.
skey
,
.
eKey
=
record
.
ekey
};
taosArrayPush
(
pData
,
&
delData
);
}
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
loadTomRecordInfoFromSttFiles
(
SArray
*
pLDataIterList
,
uint64_t
suid
,
STableBlockScanInfo
*
pBlockScanInfo
,
uint64_t
maxVer
)
{
int32_t
size
=
taosArrayGetSize
(
pLDataIterList
);
...
...
@@ -2800,8 +2829,6 @@ static int32_t loadTomRecordInfoFromSttFiles(SArray* pLDataIterList, uint64_t su
pBlockScanInfo
->
pDelData
=
taosArrayInit
(
4
,
sizeof
(
SDelData
));
}
STombRecord
record
=
{
0
};
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SArray
*
pLeveledLDataIter
=
taosArrayGetP
(
pLDataIterList
,
i
);
...
...
@@ -2814,34 +2841,13 @@ static int32_t loadTomRecordInfoFromSttFiles(SArray* pLDataIterList, uint64_t su
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
);
for
(
int32_t
j
=
0
;
j
<
pBlock
->
suid
->
size
;
++
j
)
{
int32_t
code
=
tTombBlockGet
(
pBlock
,
j
,
&
record
);
int32_t
code
=
checkTombBlockRecords
(
pBlockScanInfo
->
pDelData
,
pBlock
,
suid
,
uid
,
maxVer
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// todo handle error
}
if
(
record
.
suid
<
suid
)
{
continue
;
}
// todo use binary search instead here
if
(
record
.
uid
<
uid
)
{
continue
;
}
if
(
record
.
uid
>
uid
)
{
break
;
}
if
(
record
.
version
<=
maxVer
)
{
SDelData
delData
=
{.
version
=
record
.
version
,
.
sKey
=
record
.
skey
,
.
eKey
=
record
.
ekey
};
taosArrayPush
(
pBlockScanInfo
->
pDelData
,
&
delData
);
}
return
code
;
}
}
}
...
...
@@ -4803,7 +4809,6 @@ int32_t tsdbReaderOpen2(void* pVnode, SQueryTableDataCond* pCond, void* pTableLi
}
static
void
clearSharedPtr
(
STsdbReader
*
p
)
{
p
->
status
.
pLDataIterArray
=
NULL
;
p
->
status
.
pTableMap
=
NULL
;
p
->
status
.
uidList
.
tableUidList
=
NULL
;
p
->
pReadSnap
=
NULL
;
...
...
@@ -4814,7 +4819,6 @@ static void clearSharedPtr(STsdbReader* p) {
static
void
setSharedPtr
(
STsdbReader
*
pDst
,
const
STsdbReader
*
pSrc
)
{
pDst
->
status
.
pTableMap
=
pSrc
->
status
.
pTableMap
;
pDst
->
status
.
pLDataIterArray
=
pSrc
->
status
.
pLDataIterArray
;
pDst
->
status
.
uidList
=
pSrc
->
status
.
uidList
;
pDst
->
pSchema
=
pSrc
->
pSchema
;
pDst
->
pSchemaMap
=
pSrc
->
pSchemaMap
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录