Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
657c2dca
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看板
提交
657c2dca
编写于
7月 19, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more r/w concurrency
上级
6b454a4d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
8 deletion
+23
-8
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+13
-4
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+10
-4
未找到文件。
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
657c2dca
...
...
@@ -793,6 +793,9 @@ typedef struct {
TSDBROW
memRow
,
imemRow
,
fsRow
;
TsdbNextRowState
input
[
3
];
SMemTable
*
pMemTable
;
SMemTable
*
pIMemTable
;
STsdb
*
pTsdb
;
}
CacheNextRowIter
;
static
int32_t
nextRowIterOpen
(
CacheNextRowIter
*
pIter
,
tb_uid_t
uid
,
STsdb
*
pTsdb
)
{
...
...
@@ -800,16 +803,20 @@ static int32_t nextRowIterOpen(CacheNextRowIter *pIter, tb_uid_t uid, STsdb *pTs
tb_uid_t
suid
=
getTableSuidByUid
(
uid
,
pTsdb
);
tsdbTakeMemSnapshot
(
pTsdb
,
&
pIter
->
pMemTable
,
&
pIter
->
pIMemTable
);
STbData
*
pMem
=
NULL
;
if
(
p
Tsdb
->
mem
)
{
tsdbGetTbDataFromMemTable
(
p
Tsdb
->
mem
,
suid
,
uid
,
&
pMem
);
if
(
p
Iter
->
pMemTable
)
{
tsdbGetTbDataFromMemTable
(
p
Iter
->
pMemTable
,
suid
,
uid
,
&
pMem
);
}
STbData
*
pIMem
=
NULL
;
if
(
p
Tsdb
->
imem
)
{
tsdbGetTbDataFromMemTable
(
p
Tsdb
->
imem
,
suid
,
uid
,
&
pIMem
);
if
(
p
Iter
->
pIMemTable
)
{
tsdbGetTbDataFromMemTable
(
p
Iter
->
pIMemTable
,
suid
,
uid
,
&
pIMem
);
}
pIter
->
pTsdb
=
pTsdb
;
pIter
->
pSkyline
=
taosArrayInit
(
32
,
sizeof
(
TSDBKEY
));
SDelIdx
delIdx
;
...
...
@@ -878,6 +885,8 @@ static int32_t nextRowIterClose(CacheNextRowIter *pIter) {
taosArrayDestroy
(
pIter
->
pSkyline
);
}
tsdbUntakeMemSnapshot
(
pIter
->
pTsdb
,
pIter
->
pMemTable
,
pIter
->
pIMemTable
);
return
code
;
_err:
return
code
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
657c2dca
...
...
@@ -118,6 +118,8 @@ struct STsdbReader {
char
*
idStr
;
// query info handle, for debug purpose
int32_t
type
;
// query type: 1. retrieve all data blocks, 2. retrieve direct prev|next rows
SBlockLoadSuppInfo
suppInfo
;
SMemTable
*
pMem
;
SMemTable
*
pIMem
;
SIOCostSummary
cost
;
STSchema
*
pSchema
;
...
...
@@ -1847,8 +1849,8 @@ static int32_t initMemDataIterator(STableBlockScanInfo* pBlockScanInfo, STsdbRea
int32_t
backward
=
(
!
ASCENDING_TRAVERSE
(
pReader
->
order
));
STbData
*
d
=
NULL
;
if
(
pReader
->
p
Tsdb
->
m
em
!=
NULL
)
{
tsdbGetTbDataFromMemTable
(
pReader
->
p
Tsdb
->
m
em
,
pReader
->
suid
,
pBlockScanInfo
->
uid
,
&
d
);
if
(
pReader
->
p
M
em
!=
NULL
)
{
tsdbGetTbDataFromMemTable
(
pReader
->
p
M
em
,
pReader
->
suid
,
pBlockScanInfo
->
uid
,
&
d
);
if
(
d
!=
NULL
)
{
code
=
tsdbTbDataIterCreate
(
d
,
&
startKey
,
backward
,
&
pBlockScanInfo
->
iter
.
iter
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
...
...
@@ -1868,8 +1870,8 @@ static int32_t initMemDataIterator(STableBlockScanInfo* pBlockScanInfo, STsdbRea
}
STbData
*
di
=
NULL
;
if
(
pReader
->
p
Tsdb
->
im
em
!=
NULL
)
{
tsdbGetTbDataFromMemTable
(
pReader
->
p
Tsdb
->
im
em
,
pReader
->
suid
,
pBlockScanInfo
->
uid
,
&
di
);
if
(
pReader
->
p
IM
em
!=
NULL
)
{
tsdbGetTbDataFromMemTable
(
pReader
->
p
IM
em
,
pReader
->
suid
,
pBlockScanInfo
->
uid
,
&
di
);
if
(
di
!=
NULL
)
{
code
=
tsdbTbDataIterCreate
(
di
,
&
startKey
,
backward
,
&
pBlockScanInfo
->
iiter
.
iter
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
...
...
@@ -2809,6 +2811,8 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* pTabl
}
}
tsdbTakeMemSnapshot
(
pReader
->
pTsdb
,
&
pReader
->
pMem
,
&
pReader
->
pIMem
);
tsdbDebug
(
"%p total numOfTable:%d in this query %s"
,
pReader
,
numOfTables
,
pReader
->
idStr
);
return
code
;
...
...
@@ -2824,6 +2828,8 @@ void tsdbReaderClose(STsdbReader* pReader) {
SBlockLoadSuppInfo
*
pSupInfo
=
&
pReader
->
suppInfo
;
tsdbUntakeMemSnapshot
(
pReader
->
pTsdb
,
pReader
->
pMem
,
pReader
->
pIMem
);
taosMemoryFreeClear
(
pSupInfo
->
plist
);
taosMemoryFree
(
pSupInfo
->
colIds
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录