Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e35d1457
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看板
提交
e35d1457
编写于
5月 16, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): fix memory leak.
上级
30e7cb58
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
4 addition
and
20 deletion
+4
-20
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+0
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-10
source/dnode/vnode/src/tq/tqUtil.c
source/dnode/vnode/src/tq/tqUtil.c
+1
-1
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+0
-1
source/libs/stream/src/streamData.c
source/libs/stream/src/streamData.c
+1
-7
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
e35d1457
...
...
@@ -135,7 +135,6 @@ typedef struct {
typedef
struct
{
int8_t
type
;
int64_t
ver
;
int32_t
*
dataRef
;
SSDataBlock
*
pBlock
;
}
SStreamRefDataBlock
;
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
e35d1457
...
...
@@ -947,6 +947,8 @@ int32_t extractDelDataBlock(const void* pData, int32_t len, int64_t ver, SStream
SDecoder
*
pCoder
=
&
(
SDecoder
){
0
};
SDeleteRes
*
pRes
=
&
(
SDeleteRes
){
0
};
*
pRefBlock
=
NULL
;
pRes
->
uidList
=
taosArrayInit
(
0
,
sizeof
(
tb_uid_t
));
if
(
pRes
->
uidList
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -984,21 +986,13 @@ int32_t extractDelDataBlock(const void* pData, int32_t len, int64_t ver, SStream
}
taosArrayDestroy
(
pRes
->
uidList
);
int32_t
*
pRef
=
taosMemoryMalloc
(
sizeof
(
int32_t
));
*
pRef
=
1
;
*
pRefBlock
=
taosAllocateQitem
(
sizeof
(
SStreamRefDataBlock
),
DEF_QITEM
,
0
);
if
(
pRefBlock
==
NULL
)
{
taosMemoryFree
(
pRef
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
(
*
pRefBlock
)
->
type
=
STREAM_INPUT__REF_DATA_BLOCK
;
(
*
pRefBlock
)
->
pBlock
=
pDelBlock
;
(
*
pRefBlock
)
->
dataRef
=
pRef
;
atomic_add_fetch_32
((
*
pRefBlock
)
->
dataRef
,
1
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1069,8 +1063,6 @@ int32_t tqProcessDeleteDataReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) {
SStreamRefDataBlock
*
pRefBlock
=
taosAllocateQitem
(
sizeof
(
SStreamRefDataBlock
),
DEF_QITEM
,
0
);
pRefBlock
->
type
=
STREAM_INPUT__REF_DATA_BLOCK
;
pRefBlock
->
pBlock
=
pDelBlock
;
pRefBlock
->
dataRef
=
pRef
;
atomic_add_fetch_32
(
pRefBlock
->
dataRef
,
1
);
if
(
tAppendDataToInputQueue
(
pTask
,
(
SStreamQueueItem
*
)
pRefBlock
)
<
0
)
{
atomic_sub_fetch_32
(
pRef
,
1
);
...
...
source/dnode/vnode/src/tq/tqUtil.c
浏览文件 @
e35d1457
...
...
@@ -29,7 +29,7 @@ char* createStreamTaskIdStr(int64_t streamId, int32_t taskId) {
int32_t
tqAddInputBlockNLaunchTask
(
SStreamTask
*
pTask
,
SStreamQueueItem
*
pQueueItem
)
{
int32_t
code
=
tAppendDataToInputQueue
(
pTask
,
pQueueItem
);
if
(
code
<
0
)
{
tqError
(
"s-task:%s failed to put into queue, too many
, next ver:%"
PRId64
,
pTask
->
id
.
idStr
,
/*pPackedData->ver*/
0L
);
tqError
(
"s-task:%s failed to put into queue, too many
"
,
pTask
->
id
.
idStr
);
return
-
1
;
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
e35d1457
...
...
@@ -1912,7 +1912,6 @@ FETCH_NEXT_BLOCK:
if
(
pInfo
->
blockType
==
STREAM_INPUT__DATA_BLOCK
)
{
if
(
pInfo
->
validBlockIndex
>=
total
)
{
doClearBufferedBlocks
(
pInfo
);
/*pOperator->status = OP_EXEC_DONE;*/
return
NULL
;
}
...
...
source/libs/stream/src/streamData.c
浏览文件 @
e35d1457
...
...
@@ -194,13 +194,7 @@ void streamFreeQitem(SStreamQueueItem* data) {
taosFreeQitem
(
pMerge
);
}
else
if
(
type
==
STREAM_INPUT__REF_DATA_BLOCK
)
{
SStreamRefDataBlock
*
pRefBlock
=
(
SStreamRefDataBlock
*
)
data
;
int32_t
ref
=
atomic_sub_fetch_32
(
pRefBlock
->
dataRef
,
1
);
ASSERT
(
ref
>=
0
);
if
(
ref
==
0
)
{
blockDataDestroy
(
pRefBlock
->
pBlock
);
taosMemoryFree
(
pRefBlock
->
dataRef
);
}
taosFreeQitem
(
pRefBlock
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录