Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0bef668c
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看板
提交
0bef668c
编写于
1月 10, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[tbase-875]
上级
46ecd3b2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
9 deletion
+17
-9
src/system/detail/src/vnodeShell.c
src/system/detail/src/vnodeShell.c
+1
-1
src/system/detail/src/vnodeUtil.c
src/system/detail/src/vnodeUtil.c
+16
-8
未找到文件。
src/system/detail/src/vnodeShell.c
浏览文件 @
0bef668c
...
...
@@ -352,7 +352,7 @@ int vnodeProcessQueryRequest(char *pMsg, int msgLen, SShellObj *pObj) {
assert
(
incNumber
<=
pQueryMsg
->
numOfSids
);
pthread_mutex_unlock
(
&
pVnode
->
vmutex
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
||
pQueryMsg
->
numOfSids
==
0
)
{
// all the meters may have been dropped.
goto
_query_over
;
}
...
...
src/system/detail/src/vnodeUtil.c
浏览文件 @
0bef668c
...
...
@@ -539,10 +539,12 @@ bool vnodeIsProjectionQuery(SSqlFunctionExpr* pExpr, int32_t numOfOutput) {
* 3. insert has nothing to do with the query processing.
*/
int32_t
vnodeIncQueryRefCount
(
SQueryMeterMsg
*
pQueryMsg
,
SMeterSidExtInfo
**
pSids
,
SMeterObj
**
pMeterObjList
,
int32_t
*
numOfInc
)
{
int32_t
*
numOfInc
Tables
)
{
SVnodeObj
*
pVnode
=
&
vnodeList
[
pQueryMsg
->
vnode
];
int32_t
num
=
0
;
int32_t
index
=
0
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
for
(
int32_t
i
=
0
;
i
<
pQueryMsg
->
numOfSids
;
++
i
)
{
...
...
@@ -551,6 +553,7 @@ int32_t vnodeIncQueryRefCount(SQueryMeterMsg* pQueryMsg, SMeterSidExtInfo** pSid
/*
* If table is missing or is in dropping status, config it from management node, and ignore it
* during query processing. The error code of TSDB_CODE_NOT_ACTIVE_TABLE will never return to client.
* The missing table needs to be removed from pSids list
*/
if
(
pMeter
==
NULL
||
vnodeIsMeterState
(
pMeter
,
TSDB_METER_STATE_DROPPING
))
{
dWarn
(
"qmsg:%p, vid:%d sid:%d, not there or will be dropped, ignore this table in query"
,
pQueryMsg
,
...
...
@@ -576,9 +579,11 @@ int32_t vnodeIncQueryRefCount(SQueryMeterMsg* pQueryMsg, SMeterSidExtInfo** pSid
* vnodeIsSafeToDeleteMeter will wait for this function complete, and then it can
* check if the numOfQueries is 0 or not.
*/
pMeterObjList
[(
*
numOfInc
)
++
]
=
pMeter
;
pMeterObjList
[(
*
numOfInc
Tables
)
++
]
=
pMeter
;
atomic_fetch_add_32
(
&
pMeter
->
numOfQueries
,
1
);
pSids
[
index
++
]
=
pSids
[
i
];
// output for meter more than one query executed
if
(
pMeter
->
numOfQueries
>
1
)
{
dTrace
(
"qmsg:%p, vid:%d sid:%d id:%s, inc query ref, numOfQueries:%d"
,
pQueryMsg
,
pMeter
->
vnode
,
pMeter
->
sid
,
...
...
@@ -587,16 +592,19 @@ int32_t vnodeIncQueryRefCount(SQueryMeterMsg* pQueryMsg, SMeterSidExtInfo** pSid
}
}
dTrace
(
"qmsg:%p, query meters: %d, inc query ref %d, numOfQueries on %d meters are 1
"
,
pQueryMsg
,
pQueryMsg
->
numOfSids
,
*
numOfInc
,
(
*
numOfInc
)
-
num
);
dTrace
(
"qmsg:%p, query meters: %d, inc query ref %d, numOfQueries on %d meters are 1
, queried meters:%d after "
"filter missing meters"
,
pQueryMsg
,
pQueryMsg
->
numOfSids
,
*
numOfIncTables
,
(
*
numOfIncTables
)
-
num
,
index
);
assert
(
pQueryMsg
->
numOfSids
>=
(
*
numOfIncTables
)
&&
pQueryMsg
->
numOfSids
>=
index
);
pQueryMsg
->
numOfSids
=
index
;
return
code
;
}
void
vnodeDecQueryRefCount
(
SQueryMeterMsg
*
pQueryMsg
,
SMeterObj
**
pMeterObjList
,
int32_t
numOfInc
)
{
void
vnodeDecQueryRefCount
(
SQueryMeterMsg
*
pQueryMsg
,
SMeterObj
**
pMeterObjList
,
int32_t
numOfInc
Tables
)
{
int32_t
num
=
0
;
for
(
int32_t
i
=
0
;
i
<
numOfInc
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfInc
Tables
;
++
i
)
{
SMeterObj
*
pMeter
=
pMeterObjList
[
i
];
if
(
pMeter
!=
NULL
)
{
// here, do not need to lock to perform operations
...
...
@@ -610,7 +618,7 @@ void vnodeDecQueryRefCount(SQueryMeterMsg* pQueryMsg, SMeterObj** pMeterObjList,
}
}
dTrace
(
"qmsg:%p, dec query ref for %d meters, numOfQueries on %d meters are 0"
,
pQueryMsg
,
numOfInc
,
numOfInc
-
num
);
dTrace
(
"qmsg:%p, dec query ref for %d meters, numOfQueries on %d meters are 0"
,
pQueryMsg
,
numOfInc
Tables
,
numOfIncTables
-
num
);
}
void
vnodeUpdateQueryColumnIndex
(
SQuery
*
pQuery
,
SMeterObj
*
pMeterObj
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录