Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
40d59990
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
40d59990
编写于
7月 18, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix mem leak
上级
8ab545ac
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
13 deletion
+41
-13
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+5
-3
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+5
-9
source/libs/stream/src/streamSnapshot.c
source/libs/stream/src/streamSnapshot.c
+1
-0
source/libs/stream/src/streamTask.c
source/libs/stream/src/streamTask.c
+30
-1
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
40d59990
...
@@ -381,8 +381,11 @@ SStreamTask* tNewStreamTask(int64_t streamId, int8_t taskLevel, int8_t fillHisto
...
@@ -381,8 +381,11 @@ SStreamTask* tNewStreamTask(int64_t streamId, int8_t taskLevel, int8_t fillHisto
int32_t
tEncodeStreamTask
(
SEncoder
*
pEncoder
,
const
SStreamTask
*
pTask
);
int32_t
tEncodeStreamTask
(
SEncoder
*
pEncoder
,
const
SStreamTask
*
pTask
);
int32_t
tDecodeStreamTask
(
SDecoder
*
pDecoder
,
SStreamTask
*
pTask
);
int32_t
tDecodeStreamTask
(
SDecoder
*
pDecoder
,
SStreamTask
*
pTask
);
void
tFreeStreamTask
(
SStreamTask
*
pTask
);
void
tFreeStreamTask
(
SStreamTask
*
pTask
);
int32_t
tAppendDataToInputQueue
(
SStreamTask
*
pTask
,
SStreamQueueItem
*
pItem
);
bool
tInputQueueIsFull
(
const
SStreamTask
*
pTask
);
int32_t
tDecodeStreamTaskChkInfo
(
SDecoder
*
pDecoder
,
SCheckpointInfo
*
pChkpInfo
);
int32_t
tAppendDataToInputQueue
(
SStreamTask
*
pTask
,
SStreamQueueItem
*
pItem
);
bool
tInputQueueIsFull
(
const
SStreamTask
*
pTask
);
typedef
struct
{
typedef
struct
{
SMsgHead
head
;
SMsgHead
head
;
...
@@ -615,7 +618,6 @@ int32_t streamTaskReleaseState(SStreamTask* pTask);
...
@@ -615,7 +618,6 @@ int32_t streamTaskReleaseState(SStreamTask* pTask);
int32_t
streamTaskReloadState
(
SStreamTask
*
pTask
);
int32_t
streamTaskReloadState
(
SStreamTask
*
pTask
);
int32_t
streamAlignTransferState
(
SStreamTask
*
pTask
);
int32_t
streamAlignTransferState
(
SStreamTask
*
pTask
);
int32_t
streamAddCheckpointSourceRspMsg
(
SStreamCheckpointSourceReq
*
pReq
,
SRpcHandleInfo
*
pRpcInfo
,
SStreamTask
*
pTask
);
int32_t
streamAddCheckpointSourceRspMsg
(
SStreamCheckpointSourceReq
*
pReq
,
SRpcHandleInfo
*
pRpcInfo
,
SStreamTask
*
pTask
);
int32_t
streamAddCheckpointReadyMsg
(
SStreamTask
*
pTask
,
int32_t
srcTaskId
,
int32_t
index
,
int64_t
checkpointId
);
int32_t
streamAddCheckpointReadyMsg
(
SStreamTask
*
pTask
,
int32_t
srcTaskId
,
int32_t
index
,
int64_t
checkpointId
);
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
40d59990
...
@@ -438,18 +438,14 @@ int64_t streamGetLatestCheckpointId(SStreamMeta* pMeta) {
...
@@ -438,18 +438,14 @@ int64_t streamGetLatestCheckpointId(SStreamMeta* pMeta) {
tdbTbcMoveToFirst
(
pCur
);
tdbTbcMoveToFirst
(
pCur
);
while
(
tdbTbcNext
(
pCur
,
&
pKey
,
&
kLen
,
&
pVal
,
&
vLen
)
==
0
)
{
while
(
tdbTbcNext
(
pCur
,
&
pKey
,
&
kLen
,
&
pVal
,
&
vLen
)
==
0
)
{
SStreamTask
*
pTask
=
taosMemoryCalloc
(
1
,
sizeof
(
SStreamTask
));
SCheckpointInfo
info
;
if
(
pTask
==
NULL
)
{
goto
_err
;
}
tDecoderInit
(
&
decoder
,
(
uint8_t
*
)
pVal
,
vLen
);
tDecoderInit
(
&
decoder
,
(
uint8_t
*
)
pVal
,
vLen
);
tDecodeStreamTask
(
&
decoder
,
pTask
);
if
(
tDecodeStreamTaskChkInfo
(
&
decoder
,
&
info
)
<
0
)
{
continue
;
}
tDecoderClear
(
&
decoder
);
tDecoderClear
(
&
decoder
);
chkpId
=
TMAX
(
chkpId
,
pTask
->
chkInfo
.
checkpointId
);
chkpId
=
TMAX
(
chkpId
,
info
.
checkpointId
);
taosMemoryFree
(
pTask
);
// fix mem leak later
}
}
_err:
_err:
...
...
source/libs/stream/src/streamSnapshot.c
浏览文件 @
40d59990
...
@@ -219,6 +219,7 @@ int32_t streamSnapReaderOpen(void* pMeta, int64_t sver, int64_t ever, char* path
...
@@ -219,6 +219,7 @@ int32_t streamSnapReaderOpen(void* pMeta, int64_t sver, int64_t ever, char* path
}
}
// const char* path = NULL;
// const char* path = NULL;
if
(
streamSnapHandleInit
(
&
pReader
->
handle
,
(
char
*
)
path
)
<
0
)
{
if
(
streamSnapHandleInit
(
&
pReader
->
handle
,
(
char
*
)
path
)
<
0
)
{
taosMemoryFree
(
pReader
);
return
-
1
;
return
-
1
;
}
}
...
...
source/libs/stream/src/streamTask.c
浏览文件 @
40d59990
...
@@ -132,6 +132,35 @@ int32_t tEncodeStreamTask(SEncoder* pEncoder, const SStreamTask* pTask) {
...
@@ -132,6 +132,35 @@ int32_t tEncodeStreamTask(SEncoder* pEncoder, const SStreamTask* pTask) {
return
pEncoder
->
pos
;
return
pEncoder
->
pos
;
}
}
int32_t
tDecodeStreamTaskChkInfo
(
SDecoder
*
pDecoder
,
SCheckpointInfo
*
pChkpInfo
)
{
int64_t
skip64
;
int8_t
skip8
;
int32_t
skip32
;
int16_t
skip16
;
SEpSet
epSet
;
if
(
tStartDecode
(
pDecoder
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
skip64
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
skip32
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
skip32
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
skip8
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
skip8
)
<
0
)
return
-
1
;
if
(
tDecodeI16
(
pDecoder
,
&
skip16
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
skip8
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
skip8
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
skip32
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
skip32
)
<
0
)
return
-
1
;
if
(
tDecodeSEpSet
(
pDecoder
,
&
epSet
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pChkpInfo
->
checkpointId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pChkpInfo
->
checkpointVer
)
<
0
)
return
-
1
;
tEndDecode
(
pDecoder
);
return
0
;
}
int32_t
tDecodeStreamTask
(
SDecoder
*
pDecoder
,
SStreamTask
*
pTask
)
{
int32_t
tDecodeStreamTask
(
SDecoder
*
pDecoder
,
SStreamTask
*
pTask
)
{
if
(
tStartDecode
(
pDecoder
)
<
0
)
return
-
1
;
if
(
tStartDecode
(
pDecoder
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
id
.
streamId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
id
.
streamId
)
<
0
)
return
-
1
;
...
@@ -236,7 +265,7 @@ void tFreeStreamTask(SStreamTask* pTask) {
...
@@ -236,7 +265,7 @@ void tFreeStreamTask(SStreamTask* pTask) {
tSimpleHashCleanup
(
pTask
->
tbSink
.
pTblInfo
);
tSimpleHashCleanup
(
pTask
->
tbSink
.
pTblInfo
);
}
else
if
(
pTask
->
outputType
==
TASK_OUTPUT__SHUFFLE_DISPATCH
)
{
}
else
if
(
pTask
->
outputType
==
TASK_OUTPUT__SHUFFLE_DISPATCH
)
{
taosArrayDestroy
(
pTask
->
shuffleDispatcher
.
dbInfo
.
pVgroupInfos
);
taosArrayDestroy
(
pTask
->
shuffleDispatcher
.
dbInfo
.
pVgroupInfos
);
pTask
->
checkReqIds
=
taosArrayDestroy
(
pTask
->
checkReqIds
);
pTask
->
checkReqIds
=
taosArrayDestroy
(
pTask
->
checkReqIds
);
}
}
if
(
pTask
->
pState
)
{
if
(
pTask
->
pState
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录