Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e1046c7a
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看板
提交
e1046c7a
编写于
7月 22, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: memory leak
上级
7dfc465c
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
30 addition
and
32 deletion
+30
-32
include/libs/executor/executor.h
include/libs/executor/executor.h
+1
-1
source/dnode/vnode/src/inc/tq.h
source/dnode/vnode/src/inc/tq.h
+0
-3
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+3
-1
source/dnode/vnode/src/tq/tqExec.c
source/dnode/vnode/src/tq/tqExec.c
+4
-0
source/dnode/vnode/src/tq/tqMeta.c
source/dnode/vnode/src/tq/tqMeta.c
+2
-3
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+15
-14
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+0
-1
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-2
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+4
-7
未找到文件。
include/libs/executor/executor.h
浏览文件 @
e1046c7a
...
...
@@ -65,7 +65,7 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, SReadHandle* readers);
* @return
*/
qTaskInfo_t
qCreateQueueExecTaskInfo
(
void
*
msg
,
SReadHandle
*
readers
,
int32_t
*
numOfCols
,
SSchemaWrapper
**
pSchemaWrapper
,
int64_t
*
ntbUid
);
SSchemaWrapper
**
pSchemaWrapper
);
/**
* Set the input data block for the stream scan.
...
...
source/dnode/vnode/src/inc/tq.h
浏览文件 @
e1046c7a
...
...
@@ -110,9 +110,6 @@ typedef struct {
// exec
STqExecHandle
execHandle
;
// prevent drop
int64_t
ntbUid
;
SArray
*
colIdList
;
// SArray<int32_t>
}
STqHandle
;
struct
STQ
{
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
e1046c7a
...
...
@@ -272,6 +272,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
int32_t
code
=
0
;
STqOffsetVal
reqOffset
=
pReq
->
reqOffset
;
STqOffsetVal
fetchOffsetNew
;
SWalCkHead
*
pCkHead
=
NULL
;
// 1.find handle
STqHandle
*
pHandle
=
taosHashGet
(
pTq
->
handles
,
pReq
->
subKey
,
strlen
(
pReq
->
subKey
));
...
...
@@ -461,6 +462,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
}
OVER:
if
(
pCkHead
)
taosMemoryFree
(
pCkHead
);
// TODO wrap in destroy func
taosArrayDestroy
(
dataRsp
.
blockDataLen
);
taosArrayDestroyP
(
dataRsp
.
blockData
,
(
FDelete
)
taosMemoryFree
);
...
...
@@ -542,7 +544,7 @@ int32_t tqProcessVgChangeReq(STQ* pTq, char* msg, int32_t msgLen) {
};
pHandle
->
execHandle
.
execCol
.
task
=
qCreateQueueExecTaskInfo
(
pHandle
->
execHandle
.
execCol
.
qmsg
,
&
handle
,
&
pHandle
->
execHandle
.
numOfCols
,
&
pHandle
->
execHandle
.
pSchemaWrapper
,
&
pHandle
->
ntbUid
);
&
pHandle
->
execHandle
.
pSchemaWrapper
);
ASSERT
(
pHandle
->
execHandle
.
execCol
.
task
);
void
*
scanner
=
NULL
;
qExtractStreamScanner
(
pHandle
->
execHandle
.
execCol
.
task
,
&
scanner
);
...
...
source/dnode/vnode/src/tq/tqExec.c
浏览文件 @
e1046c7a
...
...
@@ -201,10 +201,12 @@ int32_t tqLogScanExec(STQ* pTq, STqExecHandle* pExec, SSubmitReq* pReq, SMqDataR
if
(
pRsp
->
withTbName
)
{
int64_t
uid
=
pExec
->
pExecReader
->
msgIter
.
uid
;
if
(
tqAddTbNameToRsp
(
pTq
,
uid
,
pRsp
)
<
0
)
{
blockDataFreeRes
(
&
block
);
continue
;
}
}
tqAddBlockDataToRsp
(
&
block
,
pRsp
,
taosArrayGetSize
(
block
.
pDataBlock
));
blockDataFreeRes
(
&
block
);
tqAddBlockSchemaToRsp
(
pExec
,
pRsp
);
pRsp
->
blockNum
++
;
}
...
...
@@ -220,10 +222,12 @@ int32_t tqLogScanExec(STQ* pTq, STqExecHandle* pExec, SSubmitReq* pReq, SMqDataR
if
(
pRsp
->
withTbName
)
{
int64_t
uid
=
pExec
->
pExecReader
->
msgIter
.
uid
;
if
(
tqAddTbNameToRsp
(
pTq
,
uid
,
pRsp
)
<
0
)
{
blockDataFreeRes
(
&
block
);
continue
;
}
}
tqAddBlockDataToRsp
(
&
block
,
pRsp
,
taosArrayGetSize
(
block
.
pDataBlock
));
blockDataFreeRes
(
&
block
);
tqAddBlockSchemaToRsp
(
pExec
,
pRsp
);
pRsp
->
blockNum
++
;
}
...
...
source/dnode/vnode/src/tq/tqMeta.c
浏览文件 @
e1046c7a
...
...
@@ -89,9 +89,8 @@ int32_t tqMetaOpen(STQ* pTq) {
.
version
=
handle
.
snapshotVer
,
};
handle
.
execHandle
.
execCol
.
task
=
qCreateQueueExecTaskInfo
(
handle
.
execHandle
.
execCol
.
qmsg
,
&
reader
,
&
handle
.
execHandle
.
numOfCols
,
&
handle
.
execHandle
.
pSchemaWrapper
,
&
handle
.
ntbUid
);
handle
.
execHandle
.
execCol
.
task
=
qCreateQueueExecTaskInfo
(
handle
.
execHandle
.
execCol
.
qmsg
,
&
reader
,
&
handle
.
execHandle
.
numOfCols
,
&
handle
.
execHandle
.
pSchemaWrapper
);
ASSERT
(
handle
.
execHandle
.
execCol
.
task
);
void
*
scanner
=
NULL
;
qExtractStreamScanner
(
handle
.
execHandle
.
execCol
.
task
,
&
scanner
);
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
e1046c7a
...
...
@@ -340,29 +340,30 @@ FAIL:
void
tqReaderSetColIdList
(
STqReader
*
pReadHandle
,
SArray
*
pColIdList
)
{
pReadHandle
->
pColIdList
=
pColIdList
;
}
int
tqReaderSetTbUidList
(
STqReader
*
pHandle
,
const
SArray
*
tbUidList
)
{
if
(
pHandle
->
tbIdHash
)
{
taosHashClear
(
pHandle
->
tbIdHash
);
int
tqReaderSetTbUidList
(
STqReader
*
pReader
,
const
SArray
*
tbUidList
)
{
if
(
pReader
->
tbIdHash
)
{
taosHashClear
(
pReader
->
tbIdHash
);
}
else
{
pReader
->
tbIdHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
true
,
HASH_NO_LOCK
);
}
pHandle
->
tbIdHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
true
,
HASH_NO_LOCK
);
if
(
pHandle
->
tbIdHash
==
NULL
)
{
if
(
pReader
->
tbIdHash
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
tbUidList
);
i
++
)
{
int64_t
*
pKey
=
(
int64_t
*
)
taosArrayGet
(
tbUidList
,
i
);
taosHashPut
(
p
Handle
->
tbIdHash
,
pKey
,
sizeof
(
int64_t
),
NULL
,
0
);
taosHashPut
(
p
Reader
->
tbIdHash
,
pKey
,
sizeof
(
int64_t
),
NULL
,
0
);
}
return
0
;
}
int
tqReaderAddTbUidList
(
STqReader
*
p
Handle
,
const
SArray
*
tbUidList
)
{
if
(
p
Handle
->
tbIdHash
==
NULL
)
{
p
Handle
->
tbIdHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
true
,
HASH_NO_LOCK
);
if
(
p
Handle
->
tbIdHash
==
NULL
)
{
int
tqReaderAddTbUidList
(
STqReader
*
p
Reader
,
const
SArray
*
tbUidList
)
{
if
(
p
Reader
->
tbIdHash
==
NULL
)
{
p
Reader
->
tbIdHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
true
,
HASH_NO_LOCK
);
if
(
p
Reader
->
tbIdHash
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
...
...
@@ -370,18 +371,18 @@ int tqReaderAddTbUidList(STqReader* pHandle, const SArray* tbUidList) {
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
tbUidList
);
i
++
)
{
int64_t
*
pKey
=
(
int64_t
*
)
taosArrayGet
(
tbUidList
,
i
);
taosHashPut
(
p
Handle
->
tbIdHash
,
pKey
,
sizeof
(
int64_t
),
NULL
,
0
);
taosHashPut
(
p
Reader
->
tbIdHash
,
pKey
,
sizeof
(
int64_t
),
NULL
,
0
);
}
return
0
;
}
int
tqReaderRemoveTbUidList
(
STqReader
*
p
Handle
,
const
SArray
*
tbUidList
)
{
ASSERT
(
p
Handle
->
tbIdHash
!=
NULL
);
int
tqReaderRemoveTbUidList
(
STqReader
*
p
Reader
,
const
SArray
*
tbUidList
)
{
ASSERT
(
p
Reader
->
tbIdHash
!=
NULL
);
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
tbUidList
);
i
++
)
{
int64_t
*
pKey
=
(
int64_t
*
)
taosArrayGet
(
tbUidList
,
i
);
taosHashRemove
(
p
Handle
->
tbIdHash
,
pKey
,
sizeof
(
int64_t
));
taosHashRemove
(
p
Reader
->
tbIdHash
,
pKey
,
sizeof
(
int64_t
));
}
return
0
;
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
e1046c7a
...
...
@@ -157,7 +157,6 @@ typedef struct {
SQueryTableDataCond
tableCond
;
int64_t
recoverStartVer
;
int64_t
recoverEndVer
;
int64_t
ntbUid
;
}
SStreamTaskInfo
;
typedef
struct
{
...
...
source/libs/executor/src/executor.c
浏览文件 @
e1046c7a
...
...
@@ -121,7 +121,7 @@ int32_t qSetMultiStreamInput(qTaskInfo_t tinfo, const void* pBlocks, size_t numO
}
qTaskInfo_t
qCreateQueueExecTaskInfo
(
void
*
msg
,
SReadHandle
*
readers
,
int32_t
*
numOfCols
,
SSchemaWrapper
**
pSchemaWrapper
,
int64_t
*
ntbUid
)
{
SSchemaWrapper
**
pSchemaWrapper
)
{
if
(
msg
==
NULL
)
{
// TODO create raw scan
return
NULL
;
...
...
@@ -156,7 +156,6 @@ qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* readers, int32_t* n
}
*
pSchemaWrapper
=
tCloneSSchemaWrapper
(((
SExecTaskInfo
*
)
pTaskInfo
)
->
schemaInfo
.
qsw
);
*
ntbUid
=
((
SExecTaskInfo
*
)
pTaskInfo
)
->
streamInfo
.
ntbUid
;
return
pTaskInfo
;
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
e1046c7a
...
...
@@ -4165,9 +4165,6 @@ int32_t extractTableSchemaInfo(SReadHandle* pHandle, SScanPhysiNode* pScanNode,
pSchemaInfo
->
tversion
=
mr
.
me
.
stbEntry
.
schemaTag
.
version
;
}
else
{
pSchemaInfo
->
sw
=
tCloneSSchemaWrapper
(
&
mr
.
me
.
ntbEntry
.
schemaRow
);
if
(
pTaskInfo
->
execModel
==
OPTR_EXEC_MODEL_QUEUE
)
{
pTaskInfo
->
streamInfo
.
ntbUid
=
mr
.
me
.
uid
;
}
}
metaReaderClear
(
&
mr
);
...
...
@@ -4443,10 +4440,10 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
return
createExchangeOperatorInfo
(
pHandle
->
pMsgCb
->
clientRpc
,
(
SExchangePhysiNode
*
)
pPhyNode
,
pTaskInfo
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
==
type
)
{
STableScanPhysiNode
*
pTableScanNode
=
(
STableScanPhysiNode
*
)
pPhyNode
;
STimeWindowAggSupp
aggSup
=
(
STimeWindowAggSupp
){
.
waterMark
=
pTableScanNode
->
watermark
,
.
calTrigger
=
pTableScanNode
->
triggerType
,
.
maxTs
=
INT64_MIN
,
STimeWindowAggSupp
aggSup
=
(
STimeWindowAggSupp
){
.
waterMark
=
pTableScanNode
->
watermark
,
.
calTrigger
=
pTableScanNode
->
triggerType
,
.
maxTs
=
INT64_MIN
,
};
if
(
pHandle
->
vnode
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录