Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5cac7c7a
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5cac7c7a
编写于
6月 23, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tsdb): fix error in query super table.
上级
a5049b48
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
40 addition
and
17 deletion
+40
-17
source/dnode/vnode/src/tsdb/tsdbRead2.c
source/dnode/vnode/src/tsdb/tsdbRead2.c
+40
-17
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead2.c
浏览文件 @
5cac7c7a
...
...
@@ -582,9 +582,9 @@ static int32_t initFilesetIterator(SFilesetIter* pIter, TFileSetArray* pFileSetA
static
int32_t
filesetIteratorNext
(
SFilesetIter
*
pIter
,
STsdbReader
*
pReader
,
bool
*
hasNext
)
{
bool
asc
=
ASCENDING_TRAVERSE
(
pIter
->
order
);
int32_t
step
=
asc
?
1
:
-
1
;
pIter
->
index
+=
step
;
int32_t
code
=
0
;
pIter
->
index
+=
step
;
if
((
asc
&&
pIter
->
index
>=
pIter
->
numOfFiles
)
||
((
!
asc
)
&&
pIter
->
index
<
0
))
{
*
hasNext
=
false
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -874,7 +874,7 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
}
const
TBrinBlkArray
*
pBlkArray
=
NULL
;
int32_t
code
=
tsdbDataFileReadBrinBlk
(
pFileReader
,
&
pBlkArray
);
int32_t
code
=
tsdbDataFileReadBrinBlk
(
pFileReader
,
&
pBlkArray
);
LRUHandle
*
handle
=
NULL
;
#if 0
...
...
@@ -895,14 +895,17 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
// todo binary search to the start position
int64_t
et1
=
taosGetTimestampUs
();
SBrinBlk
*
pBrinBlk
=
NULL
;
SBrinBlk
*
pBrinBlk
=
NULL
;
STableUidList
*
pList
=
&
pReader
->
status
.
uidList
;
bool
newBlk
=
false
;
int32_t
i
=
0
,
j
=
0
;
while
(
i
<
pBlkArray
->
size
&&
j
<
numOfTables
)
{
pBrinBlk
=
&
pBlkArray
->
data
[
i
];
if
(
pBrinBlk
->
maxTbid
.
suid
<
pReader
->
suid
)
{
i
+=
1
;
newBlk
=
true
;
continue
;
}
...
...
@@ -917,30 +920,39 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
continue
;
}
// this block belongs to a table that is not queried.
STableBlockScanInfo
*
pScanInfo
=
getTableBlockScanInfo
(
pReader
->
status
.
pTableMap
,
pList
->
tableUidList
[
j
],
pReader
->
idStr
);
if
(
pScanInfo
==
NULL
)
{
// tsdbBICacheRelease(pFileReader->pTsdb->biCache, handle);
return
terrno
;
}
// this block belongs to a table that is not queried.
STableBlockScanInfo
*
pScanInfo
=
getTableBlockScanInfo
(
pReader
->
status
.
pTableMap
,
pList
->
tableUidList
[
j
],
pReader
->
idStr
);
if
(
pScanInfo
==
NULL
)
{
// tsdbBICacheRelease(pFileReader->pTsdb->biCache, handle);
return
terrno
;
}
if
(
pScanInfo
->
pBlockList
==
NULL
)
{
pScanInfo
->
pBlockList
=
taosArrayInit
(
4
,
sizeof
(
SBrinRecord
));
}
if
(
pScanInfo
->
pBlockList
==
NULL
)
{
pScanInfo
->
pBlockList
=
taosArrayInit
(
4
,
sizeof
(
SBrinRecord
));
}
if
(
taosArrayGetSize
(
pIndexList
)
==
0
)
{
taosArrayPush
(
pIndexList
,
pBrinBlk
);
j
+=
1
;
}
else
{
if
(
newBlk
)
{
taosArrayPush
(
pIndexList
,
pBrinBlk
);
}
newBlk
=
false
;
}
j
+=
1
;
}
int64_t
et2
=
taosGetTimestampUs
();
tsdbDebug
(
"load block index for %d/%d tables completed, elapsed time:%.2f ms, set BrinBlk:%.2f ms, size:%.2f Kb %s"
,
numOfTables
,
(
int32_t
)
pBlkArray
->
size
,
(
et1
-
st
)
/
1000
.
0
,
(
et2
-
et1
)
/
1000
.
0
,
pBlkArray
->
size
*
sizeof
(
SBrinBlk
)
/
1024
.
0
,
pReader
->
idStr
);
numOfTables
,
(
int32_t
)
pBlkArray
->
size
,
(
et1
-
st
)
/
1000
.
0
,
(
et2
-
et1
)
/
1000
.
0
,
p
BlkArray
->
size
*
sizeof
(
SBrinBlk
)
/
1024
.
0
,
p
Reader
->
idStr
);
pReader
->
cost
.
headFileLoadTime
+=
(
et1
-
st
)
/
1000
.
0
;
_end:
// tsdbBICacheRelease(pFileReader->pTsdb->biCache, handle);
_end:
// tsdbBICacheRelease(pFileReader->pTsdb->biCache, handle);
return
code
;
}
...
...
@@ -1047,12 +1059,21 @@ static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SBlockN
while
(
pRecord
->
uid
>
uid
&&
k
<
numOfTables
)
{
k
+=
1
;
if
(
k
>=
numOfTables
)
{
break
;
}
uid
=
pReader
->
status
.
uidList
.
tableUidList
[
k
];
}
if
(
k
>=
numOfTables
)
{
break
;
}
if
(
pRecord
->
uid
<
uid
)
{
continue
;
}
ASSERT
(
pRecord
->
suid
==
pReader
->
suid
&&
uid
==
pRecord
->
uid
);
STableBlockScanInfo
*
pScanInfo
=
getTableBlockScanInfo
(
pReader
->
status
.
pTableMap
,
uid
,
pReader
->
idStr
);
...
...
@@ -1743,6 +1764,8 @@ static int32_t initBlockIterator(STsdbReader* pReader, SDataBlockIter* pBlockIte
int32_t
index
=
sup
.
indexPerTable
[
pos
]
++
;
SFileDataBlockInfo
blockInfo
=
{.
uid
=
sup
.
pDataBlockInfo
[
pos
][
index
].
uid
,
.
tbBlockIdx
=
index
};
blockInfo
.
record
=
*
(
SBrinRecord
*
)
taosArrayGet
(
sup
.
pDataBlockInfo
[
pos
][
index
].
pInfo
->
pBlockList
,
index
);
taosArrayPush
(
pBlockIter
->
blockList
,
&
blockInfo
);
// set data block index overflow, in order to disable the offset comparator
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录