Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
338f6eea
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
338f6eea
编写于
6月 05, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix invalid free in exchange.
上级
40feeffd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
24 deletion
+19
-24
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+19
-24
未找到文件。
source/libs/executor/src/executorimpl.c
浏览文件 @
338f6eea
...
...
@@ -2418,6 +2418,9 @@ int32_t loadRemoteDataCallback(void* param, const SDataBuf* pMsg, int32_t code)
pRsp
->
compLen
=
htonl
(
pRsp
->
compLen
);
pRsp
->
numOfCols
=
htonl
(
pRsp
->
numOfCols
);
pRsp
->
useconds
=
htobe64
(
pRsp
->
useconds
);
ASSERT
(
pSourceDataInfo
->
pRsp
!=
NULL
);
qDebug
(
"fetch rsp received, index:%d, rows:%d"
,
pSourceDataInfo
->
index
,
pRsp
->
numOfRows
);
}
else
{
pSourceDataInfo
->
code
=
code
;
}
...
...
@@ -2466,6 +2469,8 @@ static int32_t doSendFetchDataRequest(SExchangeInfo* pExchangeInfo, SExecTaskInf
SDownstreamSourceNode
*
pSource
=
taosArrayGet
(
pExchangeInfo
->
pSources
,
sourceIndex
);
SSourceDataInfo
*
pDataInfo
=
taosArrayGet
(
pExchangeInfo
->
pSourceDataInfo
,
sourceIndex
);
ASSERT
(
pDataInfo
->
status
==
EX_SOURCE_DATA_NOT_READY
);
qDebug
(
"%s build fetch msg and send to vgId:%d, ep:%s, taskId:0x%"
PRIx64
", %d/%"
PRIzu
,
GET_TASKID
(
pTaskInfo
),
pSource
->
addr
.
nodeId
,
pSource
->
addr
.
epSet
.
eps
[
0
].
fqdn
,
pSource
->
taskId
,
sourceIndex
,
totalSources
);
...
...
@@ -2643,7 +2648,6 @@ static SSDataBlock* concurrentlyLoadRemoteDataImpl(SOperatorInfo* pOperator, SEx
int32_t
completed
=
0
;
for
(
int32_t
i
=
0
;
i
<
totalSources
;
++
i
)
{
SSourceDataInfo
*
pDataInfo
=
taosArrayGet
(
pExchangeInfo
->
pSourceDataInfo
,
i
);
if
(
pDataInfo
->
status
==
EX_SOURCE_DATA_EXHAUSTED
)
{
completed
+=
1
;
continue
;
...
...
@@ -2653,6 +2657,11 @@ static SSDataBlock* concurrentlyLoadRemoteDataImpl(SOperatorInfo* pOperator, SEx
continue
;
}
if
(
pDataInfo
->
code
!=
TSDB_CODE_SUCCESS
)
{
code
=
pDataInfo
->
code
;
goto
_error
;
}
SRetrieveTableRsp
*
pRsp
=
pDataInfo
->
pRsp
;
SDownstreamSourceNode
*
pSource
=
taosArrayGet
(
pExchangeInfo
->
pSources
,
i
);
...
...
@@ -2690,6 +2699,8 @@ static SSDataBlock* concurrentlyLoadRemoteDataImpl(SOperatorInfo* pOperator, SEx
pLoadInfo
->
totalSize
);
}
taosMemoryFreeClear
(
pDataInfo
->
pRsp
);
if
(
pDataInfo
->
status
!=
EX_SOURCE_DATA_EXHAUSTED
)
{
pDataInfo
->
status
=
EX_SOURCE_DATA_NOT_READY
;
code
=
doSendFetchDataRequest
(
pExchangeInfo
,
pTaskInfo
,
i
);
...
...
@@ -2699,7 +2710,6 @@ static SSDataBlock* concurrentlyLoadRemoteDataImpl(SOperatorInfo* pOperator, SEx
}
}
taosMemoryFreeClear
(
pDataInfo
->
pRsp
);
return
pExchangeInfo
->
pResult
;
}
...
...
@@ -2719,26 +2729,9 @@ static SSDataBlock* concurrentlyLoadRemoteData(SOperatorInfo* pOperator) {
if
(
pOperator
->
status
==
OP_RES_TO_RETURN
)
{
return
concurrentlyLoadRemoteDataImpl
(
pOperator
,
pExchangeInfo
,
pTaskInfo
);
}
else
{
ASSERT
(
0
);
}
size_t
totalSources
=
taosArrayGetSize
(
pExchangeInfo
->
pSources
);
int64_t
startTs
=
taosGetTimestampUs
();
// Asynchronously send all fetch requests to all sources.
for
(
int32_t
i
=
0
;
i
<
totalSources
;
++
i
)
{
int32_t
code
=
doSendFetchDataRequest
(
pExchangeInfo
,
pTaskInfo
,
i
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
NULL
;
}
}
int64_t
endTs
=
taosGetTimestampUs
();
qDebug
(
"%s send all fetch request to %"
PRIzu
" sources completed, elapsed:%"
PRId64
,
GET_TASKID
(
pTaskInfo
),
totalSources
,
endTs
-
startTs
);
tsem_wait
(
&
pExchangeInfo
->
ready
);
pOperator
->
status
=
OP_RES_TO_RETURN
;
return
concurrentlyLoadRemoteDataImpl
(
pOperator
,
pExchangeInfo
,
pTaskInfo
);
}
static
int32_t
prepareConcurrentlyLoad
(
SOperatorInfo
*
pOperator
)
{
...
...
@@ -2758,10 +2751,11 @@ static int32_t prepareConcurrentlyLoad(SOperatorInfo* pOperator) {
}
int64_t
endTs
=
taosGetTimestampUs
();
qDebug
(
"%s send all fetch request to %"
PRIzu
" sources completed, elapsed:%"
PRId64
,
GET_TASKID
(
pTaskInfo
),
qDebug
(
"%s send all fetch request
s
to %"
PRIzu
" sources completed, elapsed:%"
PRId64
,
GET_TASKID
(
pTaskInfo
),
totalSources
,
endTs
-
startTs
);
tsem_wait
(
&
pExchangeInfo
->
ready
);
pOperator
->
status
=
OP_RES_TO_RETURN
;
pOperator
->
cost
.
openCost
=
taosGetTimestampUs
()
-
startTs
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -2875,7 +2869,8 @@ static SSDataBlock* doLoadRemoteData(SOperatorInfo* pOperator) {
if
(
pExchangeInfo
->
seqLoadData
)
{
return
seqLoadRemoteData
(
pOperator
);
}
else
{
return
concurrentlyLoadRemoteData
(
pOperator
);
return
concurrentlyLoadRemoteDataImpl
(
pOperator
,
pExchangeInfo
,
pTaskInfo
);
// return concurrentlyLoadRemoteData(pOperator);
}
}
...
...
@@ -2927,7 +2922,7 @@ SOperatorInfo* createExchangeOperatorInfo(void* pTransporter, const SNodeList* p
}
pInfo
->
pResult
=
pBlock
;
pInfo
->
seqLoadData
=
tru
e
;
pInfo
->
seqLoadData
=
fals
e
;
tsem_init
(
&
pInfo
->
ready
,
0
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录