Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN产品汪
TDengine
提交
d08e9972
T
TDengine
项目概览
CSDN产品汪
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
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,发现更多精彩内容 >>
提交
d08e9972
编写于
8月 05, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] prevent qinfo from being released while it is in queue.
上级
28f2f102
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
10 deletion
+19
-10
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-1
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+17
-9
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
d08e9972
...
...
@@ -6408,6 +6408,7 @@ int32_t qRetrieveQueryResultInfo(qinfo_t qinfo, bool* buildRes, void* pRspContex
return
TSDB_CODE_QRY_INVALID_QHANDLE
;
}
*
buildRes
=
false
;
SQuery
*
pQuery
=
pQInfo
->
runtimeEnv
.
pQuery
;
if
(
IS_QUERY_KILLED
(
pQInfo
))
{
qDebug
(
"QInfo:%p query is killed, code:%d"
,
pQInfo
,
pQInfo
->
code
);
...
...
@@ -6751,7 +6752,7 @@ void** qRegisterQInfo(void* pMgmt, uint64_t qInfo) {
return
NULL
;
}
const
int32_t
DEFAULT_QHANDLE_LIFE_SPAN
=
tsShellActivityTimer
*
2
;
const
int32_t
DEFAULT_QHANDLE_LIFE_SPAN
=
tsShellActivityTimer
*
2
*
1000
;
SQueryMgmt
*
pQueryMgmt
=
pMgmt
;
if
(
pQueryMgmt
->
qinfoPool
==
NULL
)
{
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
d08e9972
...
...
@@ -159,7 +159,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
// current connect is broken
if
(
code
==
TSDB_CODE_SUCCESS
)
{
handle
=
qRegisterQInfo
(
pVnode
->
qMgmt
,
(
uint64_t
)
pQInfo
);
if
(
handle
==
NULL
)
{
// failed to register qhandle
if
(
handle
==
NULL
)
{
// failed to register qhandle
, todo add error test case
vError
(
"vgId:%d QInfo:%p register qhandle failed, return to app, code:%s"
,
pVnode
->
vgId
,
(
void
*
)
pQInfo
,
tstrerror
(
pRsp
->
code
));
pRsp
->
code
=
TSDB_CODE_QRY_INVALID_QHANDLE
;
...
...
@@ -180,12 +180,9 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
}
if
(
handle
!=
NULL
)
{
vDebug
(
"vgId:%d, QInfo:%p, dnode query msg disposed, register qhandle and return to app"
,
vgId
,
*
handle
);
vDebug
(
"vgId:%d, QInfo:%p, dnode query msg disposed, create qhandle and returns to app"
,
vgId
,
*
handle
);
vnodePutItemIntoReadQueue
(
pVnode
,
*
handle
);
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
handle
,
false
);
}
}
else
{
assert
(
pCont
!=
NULL
);
...
...
@@ -194,18 +191,19 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
vWarn
(
"QInfo:%p invalid qhandle in continuing exec query, conn:%p"
,
(
void
*
)
pCont
,
pReadMsg
->
rpcMsg
.
handle
);
code
=
TSDB_CODE_QRY_INVALID_QHANDLE
;
}
else
{
vDebug
(
"vgId:%d, QInfo:%p, dnode continue exec query"
,
pVnode
->
vgId
,
(
void
*
)
pCont
);
vDebug
(
"vgId:%d, QInfo:%p, dnode continue
s to
exec query"
,
pVnode
->
vgId
,
(
void
*
)
pCont
);
bool
freehandle
=
false
;
bool
buildRes
=
qTableQuery
(
*
handle
);
// do execute query
// build query rsp
// build query rsp
, the retrieve request has reached here already
if
(
buildRes
)
{
// update the connection info according to the retrieve connection
pReadMsg
->
rpcMsg
.
handle
=
qGetResultRetrieveMsg
(
*
handle
);
assert
(
pReadMsg
->
rpcMsg
.
handle
!=
NULL
);
vDebug
(
"vgId:%d, QInfo:%p, start to build result rsp after query paused, %p"
,
pVnode
->
vgId
,
*
handle
,
pReadMsg
->
rpcMsg
.
handle
);
vDebug
(
"vgId:%d, QInfo:%p, start to build retrieval rsp after query paused, %p"
,
pVnode
->
vgId
,
*
handle
,
pReadMsg
->
rpcMsg
.
handle
);
code
=
vnodeDumpQueryResult
(
&
pReadMsg
->
rspRet
,
pVnode
,
*
handle
,
&
freehandle
);
// todo test the error code case
...
...
@@ -214,7 +212,17 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
}
}
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
handle
,
freehandle
);
// If retrieval request has not arrived, release the qhandle and decrease the reference count to allow
// the queryMgmt to free it when expired
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
handle
,
false
);
// NOTE:
// if the qhandle is put into query vread queue and wait to be executed by worker in read queue,
// the reference count of qhandle can not be decreased. Otherwise, qhandle may be released before or in the
// procedure of query execution
if
(
freehandle
)
{
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
handle
,
freehandle
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录