Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e4e72dd9
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看板
提交
e4e72dd9
编写于
12月 30, 2022
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tsdb/read): new tsdbReleaseDataBlock api from release reader's lock
上级
d3c97947
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
7 deletion
+15
-7
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+4
-3
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+8
-3
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+3
-1
未找到文件。
source/dnode/vnode/inc/vnode.h
浏览文件 @
e4e72dd9
...
...
@@ -54,7 +54,7 @@ int32_t vnodeAlter(const char *path, SAlterVnodeReplicaReq *pReq, STfs *pTfs);
void
vnodeDestroy
(
const
char
*
path
,
STfs
*
pTfs
);
SVnode
*
vnodeOpen
(
const
char
*
path
,
STfs
*
pTfs
,
SMsgCb
msgCb
);
void
vnodePreClose
(
SVnode
*
pVnode
);
void
vnodeSyncCheckTimeout
(
SVnode
*
pVnode
);
void
vnodeSyncCheckTimeout
(
SVnode
*
pVnode
);
void
vnodeClose
(
SVnode
*
pVnode
);
int32_t
vnodeStart
(
SVnode
*
pVnode
);
...
...
@@ -175,7 +175,8 @@ int32_t tsdbReaderOpen(SVnode *pVnode, SQueryTableDataCond *pCond, void *pTableL
void
tsdbReaderClose
(
STsdbReader
*
pReader
);
bool
tsdbNextDataBlock
(
STsdbReader
*
pReader
);
void
tsdbRetrieveDataBlockInfo
(
const
STsdbReader
*
pReader
,
int32_t
*
rows
,
uint64_t
*
uid
,
STimeWindow
*
pWindow
);
int32_t
tsdbRetrieveDatablockSMA
(
STsdbReader
*
pReader
,
SSDataBlock
*
pDataBlock
,
bool
*
allHave
);
int32_t
tsdbRetrieveDatablockSMA
(
STsdbReader
*
pReader
,
SSDataBlock
*
pDataBlock
,
bool
*
allHave
);
void
tsdbReleaseDataBlock
(
STsdbReader
*
pReader
);
SSDataBlock
*
tsdbRetrieveDataBlock
(
STsdbReader
*
pTsdbReadHandle
,
SArray
*
pColumnIdList
);
int32_t
tsdbReaderReset
(
STsdbReader
*
pReader
,
SQueryTableDataCond
*
pCond
);
int32_t
tsdbGetFileBlocksDistInfo
(
STsdbReader
*
pReader
,
STableBlockDistInfo
*
pTableBlockInfo
);
...
...
@@ -185,7 +186,7 @@ void *tsdbGetIvtIdx(SMeta *pMeta);
uint64_t
getReaderMaxVersion
(
STsdbReader
*
pReader
);
int32_t
tsdbCacherowsReaderOpen
(
void
*
pVnode
,
int32_t
type
,
void
*
pTableIdList
,
int32_t
numOfTables
,
int32_t
numOfCols
,
uint64_t
suid
,
void
**
pReader
,
const
char
*
idstr
);
uint64_t
suid
,
void
**
pReader
,
const
char
*
idstr
);
int32_t
tsdbRetrieveCacheRows
(
void
*
pReader
,
SSDataBlock
*
pResBlock
,
const
int32_t
*
slotIds
,
SArray
*
pTableUids
);
void
*
tsdbCacherowsReaderClose
(
void
*
pReader
);
int32_t
tsdbGetTableSchema
(
SVnode
*
pVnode
,
int64_t
uid
,
STSchema
**
pSchema
,
int64_t
*
suid
);
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
e4e72dd9
...
...
@@ -4514,13 +4514,18 @@ int64_t tsdbGetNumOfRowsInMemTable(STsdbReader* pReader) {
int64_t
rows
=
0
;
SReaderStatus
*
pStatus
=
&
pReader
->
status
;
taosThreadMutexLock
(
&
pReader
->
readerMutex
);
if
(
pReader
->
suspended
)
{
tsdbReaderResume
(
pReader
);
}
pStatus
->
pTableIter
=
taosHashIterate
(
pStatus
->
pTableMap
,
NULL
);
while
(
pStatus
->
pTableIter
!=
NULL
)
{
STableBlockScanInfo
*
pBlockScanInfo
=
*
(
STableBlockScanInfo
**
)
pStatus
->
pTableIter
;
STbData
*
d
=
NULL
;
if
(
pReader
->
p
Tsdb
->
m
em
!=
NULL
)
{
if
(
pReader
->
p
ReadSnap
->
pM
em
!=
NULL
)
{
d
=
tsdbGetTbDataFromMemTable
(
pReader
->
pReadSnap
->
pMem
,
pReader
->
suid
,
pBlockScanInfo
->
uid
);
if
(
d
!=
NULL
)
{
rows
+=
tsdbGetNRowsInTbData
(
d
);
...
...
@@ -4528,7 +4533,7 @@ int64_t tsdbGetNumOfRowsInMemTable(STsdbReader* pReader) {
}
STbData
*
di
=
NULL
;
if
(
pReader
->
p
Tsdb
->
im
em
!=
NULL
)
{
if
(
pReader
->
p
ReadSnap
->
pIM
em
!=
NULL
)
{
di
=
tsdbGetTbDataFromMemTable
(
pReader
->
pReadSnap
->
pIMem
,
pReader
->
suid
,
pBlockScanInfo
->
uid
);
if
(
di
!=
NULL
)
{
rows
+=
tsdbGetNRowsInTbData
(
di
);
...
...
@@ -4538,7 +4543,7 @@ int64_t tsdbGetNumOfRowsInMemTable(STsdbReader* pReader) {
// current table is exhausted, let's try the next table
pStatus
->
pTableIter
=
taosHashIterate
(
pStatus
->
pTableMap
,
pStatus
->
pTableIter
);
}
tsdbReleaseDataBlock
(
pReader
);
return
rows
;
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
e4e72dd9
...
...
@@ -302,12 +302,14 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca
pBlockInfo
->
window
.
skey
,
pBlockInfo
->
window
.
ekey
,
pBlockInfo
->
rows
);
pCost
->
filterOutBlocks
+=
1
;
pCost
->
totalRows
+=
pBlock
->
info
.
rows
;
tsdbReleaseDataBlock
(
pTableScanInfo
->
dataReader
);
return
TSDB_CODE_SUCCESS
;
}
else
if
(
*
status
==
FUNC_DATA_REQUIRED_NOT_LOAD
)
{
qDebug
(
"%s data block skipped, brange:%"
PRId64
"-%"
PRId64
", rows:%d"
,
GET_TASKID
(
pTaskInfo
),
pBlockInfo
->
window
.
skey
,
pBlockInfo
->
window
.
ekey
,
pBlockInfo
->
rows
);
doSetTagColumnData
(
pTableScanInfo
,
pBlock
,
pTaskInfo
,
1
);
pCost
->
skipBlocks
+=
1
;
tsdbReleaseDataBlock
(
pTableScanInfo
->
dataReader
);
return
TSDB_CODE_SUCCESS
;
}
else
if
(
*
status
==
FUNC_DATA_REQUIRED_SMA_LOAD
)
{
pCost
->
loadBlockStatis
+=
1
;
...
...
@@ -352,7 +354,7 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca
qDebug
(
"%s data block skipped due to dynamic prune, brange:%"
PRId64
"-%"
PRId64
", rows:%d"
,
GET_TASKID
(
pTaskInfo
),
pBlockInfo
->
window
.
skey
,
pBlockInfo
->
window
.
ekey
,
pBlockInfo
->
rows
);
pCost
->
skipBlocks
+=
1
;
tsdbReleaseDataBlock
(
pTableScanInfo
->
dataReader
);
*
status
=
FUNC_DATA_REQUIRED_FILTEROUT
;
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录