Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a1b9dcf5
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a1b9dcf5
编写于
5月 05, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix mem leak
上级
f20b28bc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
7 deletion
+18
-7
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+9
-6
source/libs/stream/src/streamBackendRocksdb.c
source/libs/stream/src/streamBackendRocksdb.c
+9
-1
未找到文件。
source/libs/executor/src/timewindowoperator.c
浏览文件 @
a1b9dcf5
...
...
@@ -34,7 +34,6 @@ typedef struct SStateWindowInfo {
SStateKeys
*
pStateKey
;
}
SStateWindowInfo
;
typedef
struct
SSessionAggOperatorInfo
{
SOptrBasicInfo
binfo
;
SAggSupporter
aggSup
;
...
...
@@ -1615,7 +1614,7 @@ void initIntervalDownStream(SOperatorInfo* downstream, uint16_t type, SStreamInt
}
SStreamScanInfo
*
pScanInfo
=
downstream
->
info
;
pScanInfo
->
windowSup
.
parentType
=
type
;
pScanInfo
->
windowSup
.
pIntervalAggSup
=
&
pInfo
->
aggSup
;
pScanInfo
->
windowSup
.
pIntervalAggSup
=
&
pInfo
->
aggSup
;
if
(
!
pScanInfo
->
igCheckUpdate
&&
!
pScanInfo
->
pUpdateInfo
)
{
pScanInfo
->
pUpdateInfo
=
updateInfoInitP
(
&
pInfo
->
interval
,
pInfo
->
twAggSup
.
waterMark
);
}
...
...
@@ -2504,7 +2503,8 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
pState
->
checkPointId
);
qDebug
(
"===stream===clear semi operator"
);
}
else
{
if
(
pInfo
->
twAggSup
.
maxTs
>
0
&&
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
checkPointInterval
>
pInfo
->
twAggSup
.
checkPointTs
)
{
if
(
pInfo
->
twAggSup
.
maxTs
>
0
&&
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
checkPointInterval
>
pInfo
->
twAggSup
.
checkPointTs
)
{
streamStateCommit
(
pInfo
->
pState
);
streamStateDeleteCheckPoint
(
pInfo
->
pState
,
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
deleteMark
);
pInfo
->
twAggSup
.
checkPointTs
=
pInfo
->
twAggSup
.
maxTs
;
...
...
@@ -2533,7 +2533,6 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
while
(
1
)
{
if
(
isTaskKilled
(
pTaskInfo
))
{
if
(
pInfo
->
pUpdated
!=
NULL
)
{
pInfo
->
pUpdated
=
taosArrayDestroy
(
pInfo
->
pUpdated
);
}
...
...
@@ -2857,7 +2856,7 @@ void initDownStream(SOperatorInfo* downstream, SStreamAggSupporter* pAggSup, uin
SStreamScanInfo
*
pScanInfo
=
downstream
->
info
;
pScanInfo
->
windowSup
=
(
SWindowSupporter
){.
pStreamAggSup
=
pAggSup
,
.
gap
=
pAggSup
->
gap
,
.
parentType
=
type
};
pScanInfo
->
pState
=
pAggSup
->
pState
;
if
(
(
!
pScanInfo
->
igCheckUpdate
||
type
==
QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE
)
&&
!
pScanInfo
->
pUpdateInfo
)
{
if
(
(
!
pScanInfo
->
igCheckUpdate
||
type
==
QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE
)
&&
!
pScanInfo
->
pUpdateInfo
)
{
pScanInfo
->
pUpdateInfo
=
updateInfoInit
(
60000
,
TSDB_TIME_PRECISION_MILLI
,
pTwSup
->
waterMark
);
}
pScanInfo
->
twAggSup
=
*
pTwSup
;
...
...
@@ -3061,6 +3060,7 @@ SStreamStateCur* getNextSessionWinInfo(SStreamAggSupporter* pAggSup, SSHashObj*
pNextWin
->
sessionWin
=
pCurWin
->
sessionWin
;
int32_t
code
=
streamStateSessionGetKVByCur
(
pCur
,
&
pNextWin
->
sessionWin
,
&
pNextWin
->
pOutputBuf
,
&
size
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
taosMemoryFreeClear
(
pNextWin
->
pOutputBuf
);
SET_SESSION_WIN_INVALID
(
*
pNextWin
);
}
return
pCur
;
...
...
@@ -3080,6 +3080,7 @@ static void compactSessionWindow(SOperatorInfo* pOperator, SResultWindowInfo* pC
SResultWindowInfo
winInfo
=
{
0
};
SStreamStateCur
*
pCur
=
getNextSessionWinInfo
(
pAggSup
,
pStUpdated
,
pCurWin
,
&
winInfo
);
if
(
!
IS_VALID_SESSION_WIN
(
winInfo
)
||
!
isInWindow
(
pCurWin
,
winInfo
.
sessionWin
.
win
.
skey
,
pAggSup
->
gap
))
{
taosMemoryFree
(
winInfo
.
pOutputBuf
);
streamStateFreeCur
(
pCur
);
break
;
}
...
...
@@ -3095,6 +3096,7 @@ static void compactSessionWindow(SOperatorInfo* pOperator, SResultWindowInfo* pC
removeSessionResult
(
pStUpdated
,
pAggSup
->
pResultRows
,
winInfo
.
sessionWin
);
doDeleteSessionWindow
(
pAggSup
,
&
winInfo
.
sessionWin
);
streamStateFreeCur
(
pCur
);
taosMemoryFree
(
winInfo
.
pOutputBuf
);
}
}
...
...
@@ -4723,7 +4725,8 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
return
pInfo
->
binfo
.
pRes
;
}
setOperatorCompleted
(
pOperator
);
if
(
pInfo
->
twAggSup
.
maxTs
>
0
&&
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
checkPointInterval
>
pInfo
->
twAggSup
.
checkPointTs
)
{
if
(
pInfo
->
twAggSup
.
maxTs
>
0
&&
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
checkPointInterval
>
pInfo
->
twAggSup
.
checkPointTs
)
{
streamStateCommit
(
pInfo
->
pState
);
streamStateDeleteCheckPoint
(
pInfo
->
pState
,
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
deleteMark
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
pState
->
checkPointId
);
...
...
source/libs/stream/src/streamBackendRocksdb.c
浏览文件 @
a1b9dcf5
...
...
@@ -1152,6 +1152,7 @@ int32_t streamStateSessionGet_rocksdb(SStreamState* pState, SSessionKey* key, vo
memcpy
(
*
pVal
,
tmp
,
*
pVLen
);
}
}
taosMemoryFree
(
tmp
);
streamStateFreeCur
(
pCur
);
// impl later
return
code
;
...
...
@@ -1296,7 +1297,11 @@ int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey*
if
(
len
<
0
)
{
return
-
1
;
}
if
(
pVal
!=
NULL
)
*
pVal
=
(
char
*
)
val
;
if
(
pVal
!=
NULL
)
{
*
pVal
=
(
char
*
)
val
;
}
else
{
taosMemoryFree
(
val
);
}
if
(
pVLen
!=
NULL
)
*
pVLen
=
len
;
if
(
pKTmp
->
opNum
!=
pCur
->
number
)
{
...
...
@@ -1535,13 +1540,16 @@ int32_t streamStateSessionAddIfNotExist_rocksdb(SStreamState* pState, SSessionKe
if
(
code
==
0
)
{
if
(
sessionRangeKeyCmpr
(
&
searchKey
,
key
)
==
0
)
{
memcpy
(
tmp
,
*
pVal
,
valSize
);
taosMemoryFreeClear
(
*
pVal
);
streamStateSessionDel_rocksdb
(
pState
,
key
);
goto
_end
;
}
taosMemoryFreeClear
(
*
pVal
);
streamStateCurNext_rocksdb
(
pState
,
pCur
);
}
else
{
*
key
=
originKey
;
streamStateFreeCur
(
pCur
);
taosMemoryFreeClear
(
*
pVal
);
pCur
=
streamStateSessionSeekKeyNext_rocksdb
(
pState
,
key
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录