Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9f664cbf
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
9f664cbf
编写于
6月 26, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tsdb): fix error in extracting block distribution.
上级
c161943f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
17 deletion
+19
-17
source/dnode/vnode/src/tsdb/tsdbRead2.c
source/dnode/vnode/src/tsdb/tsdbRead2.c
+17
-15
source/dnode/vnode/src/vnd/vnodeInitApi.c
source/dnode/vnode/src/vnd/vnodeInitApi.c
+2
-2
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead2.c
浏览文件 @
9f664cbf
...
...
@@ -3283,10 +3283,14 @@ static int32_t moveToNextFile(STsdbReader* pReader, SBlockNumber* pBlockNum, SAr
taosArrayDestroy
(
pIndexList
);
STFileObj
*
pTombFileObj
=
pReader
->
status
.
pCurrentFileset
->
farr
[
3
];
if
(
pTombFileObj
!=
NULL
)
{
if
(
pReader
->
status
.
pCurrentFileset
!=
NULL
)
{
STFileObj
*
pTombFileObj
=
pReader
->
status
.
pCurrentFileset
->
farr
[
3
];
if
(
pTombFileObj
!=
NULL
)
{
const
TTombBlkArray
*
pBlkArray
=
NULL
;
int32_t
code
=
tsdbDataFileReadTombBlk
(
pReader
->
pFileReader
,
&
pBlkArray
);
int32_t
code
=
tsdbDataFileReadTombBlk
(
pReader
->
pFileReader
,
&
pBlkArray
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
int32_t
i
=
0
,
j
=
0
;
...
...
@@ -3299,15 +3303,15 @@ static int32_t moveToNextFile(STsdbReader* pReader, SBlockNumber* pBlockNum, SAr
return
code
;
}
uint64_t
uid
=
pReader
->
status
.
uidList
.
tableUidList
[
j
];
uint64_t
uid
=
pReader
->
status
.
uidList
.
tableUidList
[
j
];
STableBlockScanInfo
*
pScanInfo
=
getTableBlockScanInfo
(
pReader
->
status
.
pTableMap
,
uid
,
pReader
->
idStr
);
STombRecord
record
=
{
0
};
for
(
int32_t
k
=
0
;
k
<
block
.
suid
->
size
;
++
k
)
{
for
(
int32_t
k
=
0
;
k
<
block
.
suid
->
size
;
++
k
)
{
code
=
tTombBlockGet
(
&
block
,
k
,
&
record
);
{
while
(
record
.
uid
>
uid
)
{
while
(
record
.
uid
>
uid
)
{
j
+=
1
;
uid
=
pReader
->
status
.
uidList
.
tableUidList
[
j
];
pScanInfo
=
getTableBlockScanInfo
(
pReader
->
status
.
pTableMap
,
uid
,
pReader
->
idStr
);
...
...
@@ -3327,7 +3331,7 @@ static int32_t moveToNextFile(STsdbReader* pReader, SBlockNumber* pBlockNum, SAr
}
i
+=
1
;
}
}
}
...
...
@@ -5547,6 +5551,7 @@ int32_t tsdbGetFileBlocksDistInfo2(STsdbReader* pReader, STableBlockDistInfo* pT
pTableBlockInfo
->
numOfVgroups
=
1
;
const
int32_t
numOfBuckets
=
20
.
0
;
const
int32_t
defaultRows
=
4096
;
// find the start data block in file
tsdbAcquireReader
(
pReader
);
...
...
@@ -5568,7 +5573,6 @@ int32_t tsdbGetFileBlocksDistInfo2(STsdbReader* pReader, STableBlockDistInfo* pT
pTableBlockInfo
->
numOfFiles
+=
1
;
int32_t
numOfTables
=
(
int32_t
)
tSimpleHashGetSize
(
pStatus
->
pTableMap
);
int
defaultRows
=
4096
;
SDataBlockIter
*
pBlockIter
=
&
pStatus
->
blockIter
;
pTableBlockInfo
->
numOfFiles
+=
pStatus
->
fileIter
.
numOfFiles
;
...
...
@@ -5580,13 +5584,11 @@ int32_t tsdbGetFileBlocksDistInfo2(STsdbReader* pReader, STableBlockDistInfo* pT
pTableBlockInfo
->
numOfTables
=
numOfTables
;
bool
hasNext
=
(
pBlockIter
->
numOfBlocks
>
0
);
ASSERT
(
0
);
while
(
true
)
{
if
(
hasNext
)
{
// SDataBlk* pBlock = getCurrentBlock(pBlockIter);
SFileDataBlockInfo
*
pBlockInfo
=
getCurrentBlockInfo
(
pBlockIter
);
int32_t
numOfRows
=
pBlockInfo
->
record
.
numRow
;
int32_t
numOfRows
=
0
;
//pFB->nRow;
pTableBlockInfo
->
totalRows
+=
numOfRows
;
if
(
numOfRows
>
pTableBlockInfo
->
maxRows
)
{
...
...
@@ -5601,7 +5603,7 @@ int32_t tsdbGetFileBlocksDistInfo2(STsdbReader* pReader, STableBlockDistInfo* pT
pTableBlockInfo
->
numOfSmallBlocks
+=
1
;
}
pTableBlockInfo
->
totalSize
+=
0
;
//pBlock->aSubBlock[0].szBlock
;
pTableBlockInfo
->
totalSize
+=
pBlockInfo
->
record
.
blockSize
;
int32_t
bucketIndex
=
getBucketIndex
(
pTableBlockInfo
->
defMinRows
,
bucketRange
,
numOfRows
,
numOfBuckets
);
pTableBlockInfo
->
blockRowsHisto
[
bucketIndex
]
++
;
...
...
@@ -5706,7 +5708,7 @@ int32_t tsdbGetTableSchema2(void* pVnode, int64_t uid, STSchema** pSchema, int64
}
int32_t
tsdbTakeReadSnap2
(
STsdbReader
*
pReader
,
_query_reseek_func_t
reseek
,
STsdbReadSnap
**
ppSnap
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
STsdb
*
pTsdb
=
pReader
->
pTsdb
;
SVersionRange
*
pRange
=
&
pReader
->
verRange
;
...
...
@@ -5714,7 +5716,7 @@ int32_t tsdbTakeReadSnap2(STsdbReader* pReader, _query_reseek_func_t reseek, STs
taosThreadRwlockRdlock
(
&
pTsdb
->
rwLock
);
// alloc
STsdbReadSnap
*
pSnap
=
(
STsdbReadSnap
*
)
taosMemoryCalloc
(
1
,
sizeof
(
*
p
Snap
));
STsdbReadSnap
*
pSnap
=
(
STsdbReadSnap
*
)
taosMemoryCalloc
(
1
,
sizeof
(
STsdbRead
Snap
));
if
(
pSnap
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_exit
;
...
...
source/dnode/vnode/src/vnd/vnodeInitApi.c
浏览文件 @
9f664cbf
...
...
@@ -55,8 +55,8 @@ void initTsdbReaderAPI(TsdReader* pReader) {
pReader
->
tsdReaderNotifyClosing
=
tsdbReaderSetCloseFlag
;
pReader
->
tsdReaderResetStatus
=
tsdbReaderReset2
;
pReader
->
tsdReaderGetDataBlockDistInfo
=
tsdbGetFileBlocksDistInfo
;
pReader
->
tsdReaderGetNumOfInMemRows
=
tsdbGetNumOfRowsInMemTable
;
// todo this function should be moved away
pReader
->
tsdReaderGetDataBlockDistInfo
=
tsdbGetFileBlocksDistInfo
2
;
pReader
->
tsdReaderGetNumOfInMemRows
=
tsdbGetNumOfRowsInMemTable
2
;
// todo this function should be moved away
pReader
->
tsdSetQueryTableList
=
tsdbSetTableList2
;
pReader
->
tsdSetReaderTaskId
=
(
void
(
*
)(
void
*
,
const
char
*
))
tsdbReaderSetId2
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录