Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
59912fed
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看板
提交
59912fed
编写于
9月 04, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: stream input data block memory leak
上级
57437312
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
8 deletion
+7
-8
source/dnode/vnode/src/sma/smaEnv.c
source/dnode/vnode/src/sma/smaEnv.c
+2
-1
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
+1
-1
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+4
-6
未找到文件。
source/dnode/vnode/src/sma/smaEnv.c
浏览文件 @
59912fed
...
@@ -62,7 +62,7 @@ int32_t smaInit() {
...
@@ -62,7 +62,7 @@ int32_t smaInit() {
}
}
int32_t
type
=
(
8
==
POINTER_BYTES
)
?
TSDB_DATA_TYPE_UBIGINT
:
TSDB_DATA_TYPE_UINT
;
int32_t
type
=
(
8
==
POINTER_BYTES
)
?
TSDB_DATA_TYPE_UBIGINT
:
TSDB_DATA_TYPE_UINT
;
smaMgmt
.
refHash
=
taosHashInit
(
1
,
taosGetDefaultHashFunction
(
type
),
true
,
HASH_ENTRY_LOCK
);
smaMgmt
.
refHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
type
),
true
,
HASH_ENTRY_LOCK
);
if
(
!
smaMgmt
.
refHash
)
{
if
(
!
smaMgmt
.
refHash
)
{
taosCloseRef
(
smaMgmt
.
rsetId
);
taosCloseRef
(
smaMgmt
.
rsetId
);
atomic_store_8
(
&
smaMgmt
.
inited
,
0
);
atomic_store_8
(
&
smaMgmt
.
inited
,
0
);
...
@@ -107,6 +107,7 @@ void smaCleanUp() {
...
@@ -107,6 +107,7 @@ void smaCleanUp() {
if
(
old
==
1
)
{
if
(
old
==
1
)
{
taosCloseRef
(
smaMgmt
.
rsetId
);
taosCloseRef
(
smaMgmt
.
rsetId
);
taosHashCleanup
(
smaMgmt
.
refHash
);
taosHashCleanup
(
smaMgmt
.
refHash
);
smaMgmt
.
refHash
=
NULL
;
taosTmrCleanUp
(
smaMgmt
.
tmrHandle
);
taosTmrCleanUp
(
smaMgmt
.
tmrHandle
);
smaInfo
(
"sma mgmt env is cleaned up, rsetId:%d, tmrHandle:%p"
,
smaMgmt
.
rsetId
,
smaMgmt
.
tmrHandle
);
smaInfo
(
"sma mgmt env is cleaned up, rsetId:%d, tmrHandle:%p"
,
smaMgmt
.
rsetId
,
smaMgmt
.
tmrHandle
);
atomic_store_8
(
&
smaMgmt
.
inited
,
0
);
atomic_store_8
(
&
smaMgmt
.
inited
,
0
);
...
...
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
浏览文件 @
59912fed
...
@@ -1303,7 +1303,7 @@ _err:
...
@@ -1303,7 +1303,7 @@ _err:
int32_t
tsdbWriteBlockL
(
SDataFWriter
*
pWriter
,
SArray
*
aBlockL
)
{
int32_t
tsdbWriteBlockL
(
SDataFWriter
*
pWriter
,
SArray
*
aBlockL
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
SLastFile
*
pLastFile
=
&
pWriter
->
fLast
;
SLastFile
*
pLastFile
=
&
pWriter
->
fLast
;
int64_t
size
;
int64_t
size
=
0
;
int64_t
n
;
int64_t
n
;
// check
// check
...
...
source/libs/executor/src/executor.c
浏览文件 @
59912fed
...
@@ -30,6 +30,8 @@ static void cleanupRefPool() {
...
@@ -30,6 +30,8 @@ static void cleanupRefPool() {
taosCloseRef
(
ref
);
taosCloseRef
(
ref
);
}
}
static
FORCE_INLINE
void
streamInputBlockDataDestory
(
void
*
pBlock
)
{
blockDataDestroy
((
SSDataBlock
*
)
pBlock
);
}
static
int32_t
doSetStreamBlock
(
SOperatorInfo
*
pOperator
,
void
*
input
,
size_t
numOfBlocks
,
int32_t
type
,
char
*
id
)
{
static
int32_t
doSetStreamBlock
(
SOperatorInfo
*
pOperator
,
void
*
input
,
size_t
numOfBlocks
,
int32_t
type
,
char
*
id
)
{
ASSERT
(
pOperator
!=
NULL
);
ASSERT
(
pOperator
!=
NULL
);
if
(
pOperator
->
operatorType
!=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
if
(
pOperator
->
operatorType
!=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
...
@@ -53,7 +55,7 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
...
@@ -53,7 +55,7 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
// prevent setting a different type of block
// prevent setting a different type of block
pInfo
->
validBlockIndex
=
0
;
pInfo
->
validBlockIndex
=
0
;
if
(
pInfo
->
blockType
==
STREAM_INPUT__DATA_BLOCK
)
{
if
(
pInfo
->
blockType
==
STREAM_INPUT__DATA_BLOCK
)
{
taosArrayClearP
(
pInfo
->
pBlockLists
,
taosMemoryFree
);
taosArrayClearP
(
pInfo
->
pBlockLists
,
streamInputBlockDataDestory
);
}
else
{
}
else
{
taosArrayClear
(
pInfo
->
pBlockLists
);
taosArrayClear
(
pInfo
->
pBlockLists
);
}
}
...
@@ -107,11 +109,7 @@ void tdCleanupStreamInputDataBlock(qTaskInfo_t tinfo) {
...
@@ -107,11 +109,7 @@ void tdCleanupStreamInputDataBlock(qTaskInfo_t tinfo) {
if
(
pOptrInfo
->
operatorType
==
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
if
(
pOptrInfo
->
operatorType
==
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
SStreamScanInfo
*
pInfo
=
pOptrInfo
->
info
;
SStreamScanInfo
*
pInfo
=
pOptrInfo
->
info
;
if
(
pInfo
->
blockType
==
STREAM_INPUT__DATA_BLOCK
)
{
if
(
pInfo
->
blockType
==
STREAM_INPUT__DATA_BLOCK
)
{
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pInfo
->
pBlockLists
);
++
i
)
{
taosArrayClearP
(
pInfo
->
pBlockLists
,
streamInputBlockDataDestory
);
SSDataBlock
*
p
=
*
(
SSDataBlock
**
)
taosArrayGet
(
pInfo
->
pBlockLists
,
i
);
taosArrayDestroy
(
p
->
pDataBlock
);
taosMemoryFreeClear
(
p
);
}
}
else
{
}
else
{
ASSERT
(
0
);
ASSERT
(
0
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录