Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
cdaa3871
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cdaa3871
编写于
11月 25, 2019
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor code
上级
72ce043d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
18 deletion
+21
-18
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+14
-11
src/system/detail/src/vnodeQueryProcess.c
src/system/detail/src/vnodeQueryProcess.c
+7
-7
未找到文件。
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
cdaa3871
...
...
@@ -256,9 +256,9 @@ static void doUnmapHeaderFileData(SQueryRuntimeEnv* pRuntimeEnv) {
otherVnodeFiles
->
pHeaderFileData
=
NULL
;
pRuntimeEnv
->
mmapedHFileIndex
=
-
1
;
}
else
{
assert
(
pRuntimeEnv
->
mmapedHFileIndex
==
-
1
);
}
assert
(
pRuntimeEnv
->
mmapedHFileIndex
==
-
1
);
}
/**
...
...
@@ -286,12 +286,12 @@ char *vnodeGetHeaderFileData(SQueryRuntimeEnv *pRuntimeEnv, int32_t fileIndex) {
pVnodeFiles
->
pHeaderFileData
=
mmap
(
NULL
,
size
,
PROT_READ
,
MAP_SHARED
,
pVnodeFiles
->
headerFd
,
0
);
if
(
pVnodeFiles
->
pHeaderFileData
==
MAP_FAILED
)
{
pVnodeFiles
->
pHeaderFileData
=
NULL
;
dError
(
"QInfo:%p failed to map header file:%s, size:%lld, %s"
,
pQInfo
,
pVnodeFiles
->
headerFilePath
,
size
,
dError
(
"QInfo:%p failed to m
m
ap header file:%s, size:%lld, %s"
,
pQInfo
,
pVnodeFiles
->
headerFilePath
,
size
,
strerror
(
errno
));
}
else
{
pRuntimeEnv
->
mmapedHFileIndex
=
fileIndex
;
// set the value in case of success mmap file
if
(
madvise
(
pVnodeFiles
->
pHeaderFileData
,
size
,
MADV_SEQUENTIAL
)
==
-
1
)
{
dError
(
"QInfo:%p failed to advise kernel the usage of header file
s
, reason:%s"
,
pQInfo
,
strerror
(
errno
));
dError
(
"QInfo:%p failed to advise kernel the usage of header file, reason:%s"
,
pQInfo
,
strerror
(
errno
));
}
}
}
else
{
...
...
@@ -326,9 +326,9 @@ static int vnodeGetCompBlockInfo(SMeterObj *pMeterObj, SQueryRuntimeEnv *pRuntim
pSummary
->
numOfSeek
++
;
#if 1
char
*
data
=
vnodeGetHeaderFileData
(
pRuntimeEnv
,
fileIndex
);
// failed to load the header file data into memory
char
*
data
=
vnodeGetHeaderFileData
(
pRuntimeEnv
,
fileIndex
);
if
(
data
==
NULL
)
{
return
-
1
;
return
-
1
;
// failed to load the header file data into memory
}
#else
...
...
@@ -2842,9 +2842,8 @@ int64_t loadRequiredBlockIntoMem(SQueryRuntimeEnv *pRuntimeEnv, SPositionInfo *p
* currently opened file is not the start file, reset to the start file
*/
int32_t
fileIdx
=
vnodeGetVnodeHeaderFileIdx
(
&
pQuery
->
fileId
,
pRuntimeEnv
,
pQuery
->
order
.
order
);
if
(
fileIdx
<
0
)
{
if
(
fileIdx
<
0
)
{
// ignore the files on disk
dError
(
"QInfo:%p failed to get data file:%d"
,
GET_QINFO_ADDR
(
pQuery
),
pQuery
->
fileId
);
// ignore the files on disk
position
->
fileId
=
-
1
;
return
-
1
;
}
...
...
@@ -5494,11 +5493,15 @@ SMeterDataInfo **vnodeFilterQualifiedMeters(SQInfo *pQInfo, int32_t vid, int32_t
SVnodeObj
*
pVnode
=
&
vnodeList
[
vid
];
char
*
pHeaderData
=
vnodeGetHeaderFileData
(
pRuntimeEnv
,
fileIndex
);
char
*
pHeaderFileData
=
vnodeGetHeaderFileData
(
pRuntimeEnv
,
fileIndex
);
if
(
pHeaderFileData
==
NULL
)
{
// failed to load header file into buffer
return
0
;
}
int32_t
tmsize
=
sizeof
(
SCompHeader
)
*
(
pVnode
->
cfg
.
maxSessions
)
+
sizeof
(
TSCKSUM
);
// file is corrupted, abort query in current file
if
(
validateHeaderOffsetSegment
(
pQInfo
,
pQueryFileInfo
->
headerFilePath
,
vid
,
pHeaderData
,
tmsize
)
<
0
)
{
if
(
validateHeaderOffsetSegment
(
pQInfo
,
pQueryFileInfo
->
headerFilePath
,
vid
,
pHeader
File
Data
,
tmsize
)
<
0
)
{
*
numOfMeters
=
0
;
return
0
;
}
...
...
@@ -5549,7 +5552,7 @@ SMeterDataInfo **vnodeFilterQualifiedMeters(SQInfo *pQInfo, int32_t vid, int32_t
int64_t
headerOffset
=
TSDB_FILE_HEADER_LEN
+
sizeof
(
SCompHeader
)
*
pMeterObj
->
sid
;
SCompHeader
*
compHeader
=
(
SCompHeader
*
)(
pHeaderData
+
headerOffset
);
SCompHeader
*
compHeader
=
(
SCompHeader
*
)(
pHeader
File
Data
+
headerOffset
);
if
(
compHeader
->
compInfoOffset
==
0
)
{
continue
;
...
...
src/system/detail/src/vnodeQueryProcess.c
浏览文件 @
cdaa3871
...
...
@@ -290,11 +290,14 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
pSummary
->
numOfFiles
++
;
SQueryFileInfo
*
pQueryFileInfo
=
&
pRuntimeEnv
->
pVnodeFiles
[
fileIdx
];
char
*
pHeaderData
=
vnodeGetHeaderFileData
(
pRuntimeEnv
,
fileIdx
);
if
(
pHeaderData
==
NULL
)
{
// failed to mmap header file into buffer, ignore current file, try next
continue
;
}
int32_t
numOfQualifiedMeters
=
0
;
SMeterDataInfo
**
pReqMeterDataInfo
=
vnodeFilterQualifiedMeters
(
pQInfo
,
vnodeId
,
fileIdx
,
pSupporter
->
pSidSet
,
pMeterDataInfo
,
&
numOfQualifiedMeters
);
dTrace
(
"QInfo:%p file:%s, %d meters qualified"
,
pQInfo
,
pQueryFileInfo
->
dataFilePath
,
numOfQualifiedMeters
);
if
(
pReqMeterDataInfo
==
NULL
)
{
dError
(
"QInfo:%p failed to allocate memory to perform query processing, abort"
,
pQInfo
);
...
...
@@ -304,6 +307,8 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
return
NULL
;
}
dTrace
(
"QInfo:%p file:%s, %d meters qualified"
,
pQInfo
,
pQueryFileInfo
->
dataFilePath
,
numOfQualifiedMeters
);
// none of meters in query set have pHeaderData in this file, try next file
if
(
numOfQualifiedMeters
==
0
)
{
fid
+=
step
;
...
...
@@ -311,11 +316,6 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
continue
;
}
char
*
pHeaderData
=
vnodeGetHeaderFileData
(
pRuntimeEnv
,
fileIdx
);
if
(
pHeaderData
==
NULL
)
{
// failed to mmap header file into buffer
continue
;
}
uint32_t
numOfBlocks
=
getDataBlocksForMeters
(
pSupporter
,
pQuery
,
pHeaderData
,
numOfQualifiedMeters
,
pQueryFileInfo
,
pReqMeterDataInfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录