Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3d98546d
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3d98546d
编写于
1月 20, 2020
作者:
S
slguan
提交者:
GitHub
1月 20, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1160 from taosdata/beta/v1.6.5.3
fix memory leaks
上级
cb17241f
c4d61438
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
17 addition
and
21 deletion
+17
-21
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+5
-5
src/system/detail/src/vnodeQueryProcess.c
src/system/detail/src/vnodeQueryProcess.c
+12
-16
未找到文件。
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
3d98546d
...
@@ -5980,12 +5980,12 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery
...
@@ -5980,12 +5980,12 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery
int32_t
ret
=
validateCompBlockInfoSegment
(
pQInfo
,
filePath
,
pMeterObj
->
vnode
,
&
compInfo
,
int32_t
ret
=
validateCompBlockInfoSegment
(
pQInfo
,
filePath
,
pMeterObj
->
vnode
,
&
compInfo
,
pMeterDataInfo
[
j
]
->
offsetInHeaderFile
);
pMeterDataInfo
[
j
]
->
offsetInHeaderFile
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
// file corrupted
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
// file corrupted
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
j
);
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
numOfMeters
);
return
TSDB_CODE_FILE_CORRUPTED
;
return
TSDB_CODE_FILE_CORRUPTED
;
}
}
if
(
compInfo
.
numOfBlocks
<=
0
||
compInfo
.
uid
!=
pMeterDataInfo
[
j
]
->
pMeterObj
->
uid
)
{
if
(
compInfo
.
numOfBlocks
<=
0
||
compInfo
.
uid
!=
pMeterDataInfo
[
j
]
->
pMeterObj
->
uid
)
{
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
j
);
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
numOfMeters
);
continue
;
continue
;
}
}
...
@@ -5995,7 +5995,7 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery
...
@@ -5995,7 +5995,7 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery
pMeterDataInfo
[
j
]
->
numOfBlocks
=
compInfo
.
numOfBlocks
;
pMeterDataInfo
[
j
]
->
numOfBlocks
=
compInfo
.
numOfBlocks
;
pMeterDataInfo
[
j
]
->
pBlock
=
calloc
(
1
,
bufferSize
);
pMeterDataInfo
[
j
]
->
pBlock
=
calloc
(
1
,
bufferSize
);
if
(
pMeterDataInfo
[
j
]
->
pBlock
==
NULL
)
{
if
(
pMeterDataInfo
[
j
]
->
pBlock
==
NULL
)
{
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
j
);
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
numOfMeters
);
return
TSDB_CODE_SERV_OUT_OF_MEMORY
;
return
TSDB_CODE_SERV_OUT_OF_MEMORY
;
}
}
...
@@ -6007,7 +6007,7 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery
...
@@ -6007,7 +6007,7 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery
// check compblock integrity
// check compblock integrity
ret
=
validateCompBlockSegment
(
pQInfo
,
filePath
,
&
compInfo
,
(
char
*
)
pMeterDataInfo
[
j
]
->
pBlock
,
pMeterObj
->
vnode
,
checksum
);
ret
=
validateCompBlockSegment
(
pQInfo
,
filePath
,
&
compInfo
,
(
char
*
)
pMeterDataInfo
[
j
]
->
pBlock
,
pMeterObj
->
vnode
,
checksum
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
j
);
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
numOfMeters
);
return
TSDB_CODE_FILE_CORRUPTED
;
return
TSDB_CODE_FILE_CORRUPTED
;
}
}
...
@@ -6031,7 +6031,7 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery
...
@@ -6031,7 +6031,7 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery
}
}
if
(
!
setValidDataBlocks
(
pMeterDataInfo
[
j
],
end
))
{
if
(
!
setValidDataBlocks
(
pMeterDataInfo
[
j
],
end
))
{
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
j
);
clearAllMeterDataBlockInfo
(
pMeterDataInfo
,
0
,
numOfMeters
);
pQInfo
->
killed
=
1
;
// set query kill, abort current query since no memory available
pQInfo
->
killed
=
1
;
// set query kill, abort current query since no memory available
return
TSDB_CODE_SERV_OUT_OF_MEMORY
;
return
TSDB_CODE_SERV_OUT_OF_MEMORY
;
...
...
src/system/detail/src/vnodeQueryProcess.c
浏览文件 @
3d98546d
...
@@ -85,7 +85,7 @@ static void setStartPositionForCacheBlock(SQuery *pQuery, SCacheBlock *pBlock, b
...
@@ -85,7 +85,7 @@ static void setStartPositionForCacheBlock(SQuery *pQuery, SCacheBlock *pBlock, b
}
}
}
}
static
SMeterDataInfo
*
queryOnMultiDataCache
(
SQInfo
*
pQInfo
,
SMeterDataInfo
*
pMeterInfo
)
{
static
void
queryOnMultiDataCache
(
SQInfo
*
pQInfo
,
SMeterDataInfo
*
pMeterInfo
)
{
SQuery
*
pQuery
=
&
pQInfo
->
query
;
SQuery
*
pQuery
=
&
pQInfo
->
query
;
SMeterQuerySupportObj
*
pSupporter
=
pQInfo
->
pMeterQuerySupporter
;
SMeterQuerySupportObj
*
pSupporter
=
pQInfo
->
pMeterQuerySupporter
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
pMeterQuerySupporter
->
runtimeEnv
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
pMeterQuerySupporter
->
runtimeEnv
;
...
@@ -107,7 +107,7 @@ static SMeterDataInfo *queryOnMultiDataCache(SQInfo *pQInfo, SMeterDataInfo *pMe
...
@@ -107,7 +107,7 @@ static SMeterDataInfo *queryOnMultiDataCache(SQInfo *pQInfo, SMeterDataInfo *pMe
int32_t
end
=
pSupporter
->
pSidSet
->
starterPos
[
groupIdx
+
1
]
-
1
;
int32_t
end
=
pSupporter
->
pSidSet
->
starterPos
[
groupIdx
+
1
]
-
1
;
if
(
isQueryKilled
(
pQuery
))
{
if
(
isQueryKilled
(
pQuery
))
{
return
pMeterInfo
;
return
;
}
}
for
(
int32_t
k
=
start
;
k
<=
end
;
++
k
)
{
for
(
int32_t
k
=
start
;
k
<=
end
;
++
k
)
{
...
@@ -160,7 +160,7 @@ static SMeterDataInfo *queryOnMultiDataCache(SQInfo *pQInfo, SMeterDataInfo *pMe
...
@@ -160,7 +160,7 @@ static SMeterDataInfo *queryOnMultiDataCache(SQInfo *pQInfo, SMeterDataInfo *pMe
int32_t
ret
=
setIntervalQueryExecutionContext
(
pSupporter
,
k
,
pMeterQueryInfo
);
int32_t
ret
=
setIntervalQueryExecutionContext
(
pSupporter
,
k
,
pMeterQueryInfo
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
pQInfo
->
killed
=
1
;
pQInfo
->
killed
=
1
;
return
NULL
;
return
;
}
}
}
}
...
@@ -255,11 +255,9 @@ static SMeterDataInfo *queryOnMultiDataCache(SQInfo *pQInfo, SMeterDataInfo *pMe
...
@@ -255,11 +255,9 @@ static SMeterDataInfo *queryOnMultiDataCache(SQInfo *pQInfo, SMeterDataInfo *pMe
dTrace
(
"QInfo:%p complete check %d cache blocks, elapsed time:%.3fms"
,
pQInfo
,
totalBlocks
,
time
/
1000
.
0
);
dTrace
(
"QInfo:%p complete check %d cache blocks, elapsed time:%.3fms"
,
pQInfo
,
totalBlocks
,
time
/
1000
.
0
);
setQueryStatus
(
pQuery
,
QUERY_NOT_COMPLETED
);
setQueryStatus
(
pQuery
,
QUERY_NOT_COMPLETED
);
return
pMeterInfo
;
}
}
static
SMeterDataInfo
*
queryOnMultiDataFiles
(
SQInfo
*
pQInfo
,
SMeterDataInfo
*
pMeterDataInfo
)
{
static
void
queryOnMultiDataFiles
(
SQInfo
*
pQInfo
,
SMeterDataInfo
*
pMeterDataInfo
)
{
SQuery
*
pQuery
=
&
pQInfo
->
query
;
SQuery
*
pQuery
=
&
pQInfo
->
query
;
SMeterQuerySupportObj
*
pSupporter
=
pQInfo
->
pMeterQuerySupporter
;
SMeterQuerySupportObj
*
pSupporter
=
pQInfo
->
pMeterQuerySupporter
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pSupporter
->
runtimeEnv
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pSupporter
->
runtimeEnv
;
...
@@ -313,7 +311,7 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
...
@@ -313,7 +311,7 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
pQInfo
->
code
=
-
ret
;
pQInfo
->
code
=
-
ret
;
pQInfo
->
killed
=
1
;
pQInfo
->
killed
=
1
;
return
NULL
;
return
;
}
}
dTrace
(
"QInfo:%p file:%s, %d meters qualified"
,
pQInfo
,
pVnodeFileInfo
->
dataFilePath
,
numOfQualifiedMeters
);
dTrace
(
"QInfo:%p file:%s, %d meters qualified"
,
pQInfo
,
pVnodeFileInfo
->
dataFilePath
,
numOfQualifiedMeters
);
...
@@ -335,7 +333,7 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
...
@@ -335,7 +333,7 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
pQInfo
->
code
=
-
ret
;
pQInfo
->
code
=
-
ret
;
pQInfo
->
killed
=
1
;
pQInfo
->
killed
=
1
;
return
NULL
;
return
;
}
}
dTrace
(
"QInfo:%p file:%s, %d meters contains %d blocks to be checked"
,
pQInfo
,
pVnodeFileInfo
->
dataFilePath
,
dTrace
(
"QInfo:%p file:%s, %d meters contains %d blocks to be checked"
,
pQInfo
,
pVnodeFileInfo
->
dataFilePath
,
...
@@ -355,7 +353,7 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
...
@@ -355,7 +353,7 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
pQInfo
->
code
=
-
ret
;
pQInfo
->
code
=
-
ret
;
pQInfo
->
killed
=
1
;
pQInfo
->
killed
=
1
;
return
NULL
;
return
;
}
}
dTrace
(
"QInfo:%p start to load %d blocks and check"
,
pQInfo
,
numOfBlocks
);
dTrace
(
"QInfo:%p start to load %d blocks and check"
,
pQInfo
,
numOfBlocks
);
...
@@ -412,7 +410,7 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
...
@@ -412,7 +410,7 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
tfree
(
pReqMeterDataInfo
);
// error code has been set
tfree
(
pReqMeterDataInfo
);
// error code has been set
pQInfo
->
killed
=
1
;
pQInfo
->
killed
=
1
;
return
NULL
;
return
;
}
}
}
}
...
@@ -461,8 +459,6 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
...
@@ -461,8 +459,6 @@ static SMeterDataInfo *queryOnMultiDataFiles(SQInfo *pQInfo, SMeterDataInfo *pMe
setQueryStatus
(
pQuery
,
QUERY_NOT_COMPLETED
);
setQueryStatus
(
pQuery
,
QUERY_NOT_COMPLETED
);
freeMeterBlockInfoEx
(
pDataBlockInfoEx
,
nAllocBlocksInfoSize
);
freeMeterBlockInfoEx
(
pDataBlockInfoEx
,
nAllocBlocksInfoSize
);
return
pMeterDataInfo
;
}
}
static
bool
multimeterMultioutputHelper
(
SQInfo
*
pQInfo
,
bool
*
dataInDisk
,
bool
*
dataInCache
,
int32_t
index
,
static
bool
multimeterMultioutputHelper
(
SQInfo
*
pQInfo
,
bool
*
dataInDisk
,
bool
*
dataInCache
,
int32_t
index
,
...
@@ -811,19 +807,19 @@ static void doOrderedScan(SQInfo *pQInfo) {
...
@@ -811,19 +807,19 @@ static void doOrderedScan(SQInfo *pQInfo) {
SQuery
*
pQuery
=
&
pQInfo
->
query
;
SQuery
*
pQuery
=
&
pQInfo
->
query
;
if
(
QUERY_IS_ASC_QUERY
(
pQuery
))
{
if
(
QUERY_IS_ASC_QUERY
(
pQuery
))
{
pSupporter
->
pMeterDataInfo
=
queryOnMultiDataFiles
(
pQInfo
,
pSupporter
->
pMeterDataInfo
);
queryOnMultiDataFiles
(
pQInfo
,
pSupporter
->
pMeterDataInfo
);
if
(
pQInfo
->
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
pQInfo
->
code
!=
TSDB_CODE_SUCCESS
)
{
return
;
return
;
}
}
pSupporter
->
pMeterDataInfo
=
queryOnMultiDataCache
(
pQInfo
,
pSupporter
->
pMeterDataInfo
);
queryOnMultiDataCache
(
pQInfo
,
pSupporter
->
pMeterDataInfo
);
}
else
{
}
else
{
pSupporter
->
pMeterDataInfo
=
queryOnMultiDataCache
(
pQInfo
,
pSupporter
->
pMeterDataInfo
);
queryOnMultiDataCache
(
pQInfo
,
pSupporter
->
pMeterDataInfo
);
if
(
pQInfo
->
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
pQInfo
->
code
!=
TSDB_CODE_SUCCESS
)
{
return
;
return
;
}
}
pSupporter
->
pMeterDataInfo
=
queryOnMultiDataFiles
(
pQInfo
,
pSupporter
->
pMeterDataInfo
);
queryOnMultiDataFiles
(
pQInfo
,
pSupporter
->
pMeterDataInfo
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录