Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d5fabd53
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看板
提交
d5fabd53
编写于
5月 21, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: rpc msg handler
上级
1146196f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
26 deletion
+21
-26
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+1
-19
source/dnode/mnode/impl/src/mndQuery.c
source/dnode/mnode/impl/src/mndQuery.c
+20
-7
未找到文件。
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
d5fabd53
...
...
@@ -56,24 +56,6 @@ static void mmProcessQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
taosFreeQitem
(
pMsg
);
}
static
void
mmProcessQueryQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
dTrace
(
"msg:%p, get from mnode-query queue"
,
pMsg
);
pMsg
->
info
.
node
=
pMgmt
->
pMnode
;
code
=
mndProcessMsg
(
pMsg
);
if
(
IsReq
(
pMsg
)
&&
pMsg
->
info
.
handle
!=
NULL
&&
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
mmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
static
int32_t
mmPutNodeMsgToWorker
(
SSingleWorker
*
pWorker
,
SRpcMsg
*
pMsg
)
{
dTrace
(
"msg:%p, put into worker %s, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pMsg
->
msgType
));
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
...
...
@@ -131,7 +113,7 @@ int32_t mmStartWorker(SMnodeMgmt *pMgmt) {
.
min
=
tsNumOfMnodeQueryThreads
,
.
max
=
tsNumOfMnodeQueryThreads
,
.
name
=
"mnode-query"
,
.
fp
=
(
FItem
)
mmProcessQue
ryQue
ue
,
.
fp
=
(
FItem
)
mmProcessQueue
,
.
param
=
pMgmt
,
};
if
(
tSingleWorkerInit
(
&
pMgmt
->
queryWorker
,
&
qCfg
)
!=
0
)
{
...
...
source/dnode/mnode/impl/src/mndQuery.c
浏览文件 @
d5fabd53
...
...
@@ -19,36 +19,49 @@
#include "qworker.h"
int32_t
mndProcessQueryMsg
(
SRpcMsg
*
pReq
)
{
int32_t
code
=
-
1
;
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SReadHandle
handle
=
{.
mnd
=
pMnode
,
.
pMsgCb
=
&
pMnode
->
msgCb
};
mTrace
(
"msg:%p, in query queue is processing"
,
pReq
);
switch
(
pReq
->
msgType
)
{
case
TDMT_VND_QUERY
:
return
qWorkerProcessQueryMsg
(
&
handle
,
pMnode
->
pQuery
,
pReq
);
code
=
qWorkerProcessQueryMsg
(
&
handle
,
pMnode
->
pQuery
,
pReq
);
break
;
case
TDMT_VND_QUERY_CONTINUE
:
return
qWorkerProcessCQueryMsg
(
&
handle
,
pMnode
->
pQuery
,
pReq
);
code
=
qWorkerProcessCQueryMsg
(
&
handle
,
pMnode
->
pQuery
,
pReq
);
break
;
default:
terrno
=
TSDB_CODE_VND_APP_ERROR
;
mError
(
"unknown msg type:%d in query queue"
,
pReq
->
msgType
);
return
TSDB_CODE_VND_APP_ERROR
;
}
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
return
code
;
}
int32_t
mndProcessFetchMsg
(
SRpcMsg
*
pMsg
)
{
int32_t
code
=
-
1
;
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
mTrace
(
"msg:%p, in fetch queue is processing"
,
pMsg
);
switch
(
pMsg
->
msgType
)
{
case
TDMT_VND_FETCH
:
return
qWorkerProcessFetchMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessFetchMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_DROP_TASK
:
return
qWorkerProcessDropMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessDropMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_QUERY_HEARTBEAT
:
return
qWorkerProcessHbMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessHbMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
break
;
default:
terrno
=
TSDB_CODE_VND_APP_ERROR
;
mError
(
"unknown msg type:%d in fetch queue"
,
pMsg
->
msgType
);
return
TSDB_CODE_VND_APP_ERROR
;
}
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
return
code
;
}
int32_t
mndInitQuery
(
SMnode
*
pMnode
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录