Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mr、小李
TDengine
提交
d838bacd
T
TDengine
项目概览
Mr、小李
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d838bacd
编写于
10月 14, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-1637]
上级
4c22b72d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
21 addition
and
16 deletion
+21
-16
src/client/src/tscLocalMerge.c
src/client/src/tscLocalMerge.c
+1
-0
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+18
-15
未找到文件。
src/client/src/tscLocalMerge.c
浏览文件 @
d838bacd
...
...
@@ -742,6 +742,7 @@ void tscLocalReducerEnvDestroy(tExtMemBuffer **pMemBuffer, tOrderDescriptor *pDe
int32_t
numOfVnodes
)
{
destroyColumnModel
(
pFinalModel
);
tOrderDescDestroy
(
pDesc
);
for
(
int32_t
i
=
0
;
i
<
numOfVnodes
;
++
i
)
{
pMemBuffer
[
i
]
=
destoryExtMemBuffer
(
pMemBuffer
[
i
]);
}
...
...
src/client/src/tscServer.c
浏览文件 @
d838bacd
...
...
@@ -475,6 +475,7 @@ void tscKillSTableQuery(SSqlObj *pSql) {
return
;
}
// set the master sqlObj flag to cancel query
pSql
->
res
.
code
=
TSDB_CODE_TSC_QUERY_CANCELLED
;
for
(
int
i
=
0
;
i
<
pSql
->
subState
.
numOfSub
;
++
i
)
{
...
...
@@ -498,7 +499,7 @@ void tscKillSTableQuery(SSqlObj *pSql) {
pSubObj
->
pRpcCtx
=
NULL
;
}
tscQueueAsyncRes
(
pSubObj
);
// async res? not other functions?
//
tscQueueAsyncRes(pSubObj); // async res? not other functions?
taosCacheRelease
(
tscObjCache
,
(
void
**
)
&
p
,
false
);
}
...
...
src/client/src/tscSubquery.c
浏览文件 @
d838bacd
...
...
@@ -1491,9 +1491,16 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
return
TSDB_CODE_SUCCESS
;
}
static
void
tscFree
SubSqlObj
(
SRetrieveSupport
*
trsupport
,
SSqlObj
*
pSql
)
{
tscDebug
(
"%p start to free subquery obj"
,
pSql
)
;
static
void
tscFree
RetrieveSup
(
SSqlObj
*
pSql
)
{
SRetrieveSupport
*
trsupport
=
pSql
->
param
;
void
*
p
=
atomic_val_compare_exchange_ptr
(
&
pSql
->
param
,
trsupport
,
0
);
if
(
p
==
NULL
)
{
tscDebug
(
"%p retrieve supp already released"
,
pSql
);
return
;
}
tscDebug
(
"%p start to free subquery supp obj:%p"
,
pSql
,
trsupport
);
// int32_t index = trsupport->subqueryIndex;
// SSqlObj *pParentSql = trsupport->pParentSql;
...
...
@@ -1560,13 +1567,9 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO
int32_t
subqueryIndex
=
trsupport
->
subqueryIndex
;
assert
(
pSql
!=
NULL
);
SSubqueryState
*
pState
=
&
pParentSql
->
subState
;
int32_t
remain
=
pState
->
numOfRemain
;
int32_t
sub
=
pState
->
numOfSub
;
UNUSED
(
remain
);
UNUSED
(
sub
);
assert
(
pParentSql
->
subState
.
numOfRemain
<=
pState
->
numOfSub
&&
pParentSql
->
subState
.
numOfRemain
>=
0
);
SSubqueryState
*
pState
=
&
pParentSql
->
subState
;
assert
(
pState
->
numOfRemain
<=
pState
->
numOfSub
&&
pState
->
numOfRemain
>=
0
);
// retrieved in subquery failed. OR query cancelled in retrieve phase.
if
(
taos_errno
(
pSql
)
==
TSDB_CODE_SUCCESS
&&
pParentSql
->
res
.
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -1597,12 +1600,12 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO
}
}
remain
=
-
1
;
if
((
remain
=
atomic_sub_fetch_32
(
&
p
ParentSql
->
subState
.
numOfRemain
,
1
))
>
0
)
{
int32_t
remain
=
-
1
;
if
((
remain
=
atomic_sub_fetch_32
(
&
p
State
->
numOfRemain
,
1
))
>
0
)
{
tscDebug
(
"%p sub:%p orderOfSub:%d freed, finished subqueries:%d"
,
pParentSql
,
pSql
,
trsupport
->
subqueryIndex
,
pState
->
numOfSub
-
remain
);
tscFree
SubSqlObj
(
trsupport
,
pSql
);
tscFree
RetrieveSup
(
pSql
);
return
;
}
...
...
@@ -1614,7 +1617,7 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO
tscLocalReducerEnvDestroy
(
trsupport
->
pExtMemBuffer
,
trsupport
->
pOrderDescriptor
,
trsupport
->
pFinalColModel
,
pState
->
numOfSub
);
tscFree
SubSqlObj
(
trsupport
,
pSql
);
tscFree
RetrieveSup
(
pSql
);
// in case of second stage join subquery, invoke its callback function instead of regular QueueAsyncRes
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
&
pParentSql
->
cmd
,
0
);
...
...
@@ -1674,7 +1677,7 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p
tscDebug
(
"%p sub:%p orderOfSub:%d freed, finished subqueries:%d"
,
pParentSql
,
pSql
,
trsupport
->
subqueryIndex
,
pState
->
numOfSub
-
remain
);
tscFree
SubSqlObj
(
trsupport
,
pSql
);
tscFree
RetrieveSup
(
pSql
);
return
;
}
...
...
@@ -1694,7 +1697,7 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p
pParentSql
->
res
.
numOfRows
=
0
;
pParentSql
->
res
.
row
=
0
;
tscFree
SubSqlObj
(
trsupport
,
pSql
);
tscFree
RetrieveSup
(
pSql
);
// set the command flag must be after the semaphore been correctly set.
pParentSql
->
cmd
.
command
=
TSDB_SQL_RETRIEVE_LOCALMERGE
;
...
...
@@ -1711,8 +1714,8 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
int32_t
idx
=
trsupport
->
subqueryIndex
;
SSqlObj
*
pParentSql
=
trsupport
->
pParentSql
;
assert
(
tres
!=
NULL
);
SSqlObj
*
pSql
=
(
SSqlObj
*
)
tres
;
assert
(
pSql
!=
NULL
&&
trsupport
==
pSql
->
param
);
SSubqueryState
*
pState
=
&
pParentSql
->
subState
;
assert
(
pState
->
numOfRemain
<=
pState
->
numOfSub
&&
pState
->
numOfRemain
>=
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录