Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e18d7de9
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看板
提交
e18d7de9
编写于
3月 25, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/qnode
上级
77898958
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
32 addition
and
13 deletion
+32
-13
include/common/tmsgcb.h
include/common/tmsgcb.h
+1
-1
source/dnode/mgmt/mnode/inc/mmInt.h
source/dnode/mgmt/mnode/inc/mmInt.h
+4
-1
source/dnode/mgmt/mnode/src/mmInt.c
source/dnode/mgmt/mnode/src/mmInt.c
+3
-2
source/dnode/mgmt/mnode/src/mmMsg.c
source/dnode/mgmt/mnode/src/mmMsg.c
+5
-5
source/dnode/mgmt/mnode/src/mmWorker.c
source/dnode/mgmt/mnode/src/mmWorker.c
+17
-2
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+2
-2
未找到文件。
include/common/tmsgcb.h
浏览文件 @
e18d7de9
...
@@ -25,7 +25,7 @@ extern "C" {
...
@@ -25,7 +25,7 @@ extern "C" {
typedef
struct
SRpcMsg
SRpcMsg
;
typedef
struct
SRpcMsg
SRpcMsg
;
typedef
struct
SEpSet
SEpSet
;
typedef
struct
SEpSet
SEpSet
;
typedef
struct
SMgmtWrapper
SMgmtWrapper
;
typedef
struct
SMgmtWrapper
SMgmtWrapper
;
typedef
enum
{
QUERY_QUEUE
,
FETCH_QUEUE
,
WRITE_QUEUE
,
APPLY_QUEUE
,
SYNC_QUEUE
,
QUEUE_MAX
}
EQueueType
;
typedef
enum
{
QUERY_QUEUE
,
FETCH_QUEUE
,
READ_QUEUE
,
WRITE_QUEUE
,
APPLY_QUEUE
,
SYNC_QUEUE
,
QUEUE_MAX
}
EQueueType
;
typedef
int32_t
(
*
PutToQueueFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pReq
);
typedef
int32_t
(
*
PutToQueueFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pReq
);
typedef
int32_t
(
*
GetQueueSizeFp
)(
SMgmtWrapper
*
pWrapper
,
int32_t
vgId
,
EQueueType
qtype
);
typedef
int32_t
(
*
GetQueueSizeFp
)(
SMgmtWrapper
*
pWrapper
,
int32_t
vgId
,
EQueueType
qtype
);
...
...
source/dnode/mgmt/mnode/inc/mmInt.h
浏览文件 @
e18d7de9
...
@@ -28,6 +28,7 @@ typedef struct SMnodeMgmt {
...
@@ -28,6 +28,7 @@ typedef struct SMnodeMgmt {
SDnode
*
pDnode
;
SDnode
*
pDnode
;
SMgmtWrapper
*
pWrapper
;
SMgmtWrapper
*
pWrapper
;
const
char
*
path
;
const
char
*
path
;
SSingleWorker
queryWorker
;
SSingleWorker
readWorker
;
SSingleWorker
readWorker
;
SSingleWorker
writeWorker
;
SSingleWorker
writeWorker
;
SSingleWorker
syncWorker
;
SSingleWorker
syncWorker
;
...
@@ -57,11 +58,13 @@ void mmStopWorker(SMnodeMgmt *pMgmt);
...
@@ -57,11 +58,13 @@ void mmStopWorker(SMnodeMgmt *pMgmt);
int32_t
mmProcessWriteMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessWriteMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessSyncMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessSyncMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessReadMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessReadMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessQueryMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmPutMsgToWriteQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpcMsg
);
int32_t
mmPutMsgToWriteQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpcMsg
);
int32_t
mmPutMsgToReadQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpcMsg
);
int32_t
mmPutMsgToReadQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpcMsg
);
int32_t
mmPutMsgToQueryQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
#endif
/*_TD_DND_MNODE_INT_H_*/
#endif
/*_TD_DND_MNODE_INT_H_*/
\ No newline at end of file
source/dnode/mgmt/mnode/src/mmInt.c
浏览文件 @
e18d7de9
...
@@ -45,7 +45,8 @@ static void mmInitOption(SMnodeMgmt *pMgmt, SMnodeOpt *pOption) {
...
@@ -45,7 +45,8 @@ static void mmInitOption(SMnodeMgmt *pMgmt, SMnodeOpt *pOption) {
SMsgCb
msgCb
=
{
0
};
SMsgCb
msgCb
=
{
0
};
msgCb
.
pWrapper
=
pMgmt
->
pWrapper
;
msgCb
.
pWrapper
=
pMgmt
->
pWrapper
;
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
mmPutMsgToReadQueue
;
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
mmPutMsgToQueryQueue
;
msgCb
.
queueFps
[
READ_QUEUE
]
=
mmPutMsgToReadQueue
;
msgCb
.
queueFps
[
WRITE_QUEUE
]
=
mmPutMsgToWriteQueue
;
msgCb
.
queueFps
[
WRITE_QUEUE
]
=
mmPutMsgToWriteQueue
;
msgCb
.
sendReqFp
=
dndSendReqToDnode
;
msgCb
.
sendReqFp
=
dndSendReqToDnode
;
msgCb
.
sendMnodeReqFp
=
dndSendReqToMnode
;
msgCb
.
sendMnodeReqFp
=
dndSendReqToMnode
;
...
@@ -258,4 +259,4 @@ int32_t mmMonitorMnodeInfo(SMgmtWrapper *pWrapper, SMonClusterInfo *pClusterInfo
...
@@ -258,4 +259,4 @@ int32_t mmMonitorMnodeInfo(SMgmtWrapper *pWrapper, SMonClusterInfo *pClusterInfo
SMonGrantInfo
*
pGrantInfo
)
{
SMonGrantInfo
*
pGrantInfo
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
return
mndGetMonitorInfo
(
pMgmt
->
pMnode
,
pClusterInfo
,
pVgroupInfo
,
pGrantInfo
);
return
mndGetMonitorInfo
(
pMgmt
->
pMnode
,
pClusterInfo
,
pVgroupInfo
,
pGrantInfo
);
}
}
\ No newline at end of file
source/dnode/mgmt/mnode/src/mmMsg.c
浏览文件 @
e18d7de9
...
@@ -156,10 +156,10 @@ void mmInitMsgHandles(SMgmtWrapper *pWrapper) {
...
@@ -156,10 +156,10 @@ void mmInitMsgHandles(SMgmtWrapper *pWrapper) {
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_SMA_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
VND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_SMA_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
VND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_SMA_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
VND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_SMA_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
,
VND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY
,
(
NodeMsgFp
)
mmProcess
Read
Msg
,
MND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY
,
(
NodeMsgFp
)
mmProcess
Query
Msg
,
MND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_CONTINUE
,
(
NodeMsgFp
)
mmProcess
Read
Msg
,
MND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_CONTINUE
,
(
NodeMsgFp
)
mmProcess
Query
Msg
,
MND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_FETCH
,
(
NodeMsgFp
)
mmProcess
Read
Msg
,
MND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_FETCH
,
(
NodeMsgFp
)
mmProcess
Query
Msg
,
MND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_TASK
,
(
NodeMsgFp
)
mmProcess
Read
Msg
,
MND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_TASK
,
(
NodeMsgFp
)
mmProcess
Query
Msg
,
MND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_HEARTBEAT
,
(
NodeMsgFp
)
mmProcess
Read
Msg
,
MND_VGID
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_HEARTBEAT
,
(
NodeMsgFp
)
mmProcess
Query
Msg
,
MND_VGID
);
}
}
source/dnode/mgmt/mnode/src/mmWorker.c
浏览文件 @
e18d7de9
...
@@ -61,6 +61,10 @@ int32_t mmProcessReadMsg(SMnodeMgmt *pMgmt, SNodeMsg *pMsg) {
...
@@ -61,6 +61,10 @@ int32_t mmProcessReadMsg(SMnodeMgmt *pMgmt, SNodeMsg *pMsg) {
return
mmPutMsgToWorker
(
pMgmt
,
&
pMgmt
->
readWorker
,
pMsg
);
return
mmPutMsgToWorker
(
pMgmt
,
&
pMgmt
->
readWorker
,
pMsg
);
}
}
int32_t
mmProcessQueryMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
return
mmPutMsgToWorker
(
pMgmt
,
&
pMgmt
->
queryWorker
,
pMsg
);
}
static
int32_t
mmPutRpcMsgToWorker
(
SMnodeMgmt
*
pMgmt
,
SSingleWorker
*
pWorker
,
SRpcMsg
*
pRpc
)
{
static
int32_t
mmPutRpcMsgToWorker
(
SMnodeMgmt
*
pMgmt
,
SSingleWorker
*
pWorker
,
SRpcMsg
*
pRpc
)
{
SNodeMsg
*
pMsg
=
taosAllocateQitem
(
sizeof
(
SNodeMsg
));
SNodeMsg
*
pMsg
=
taosAllocateQitem
(
sizeof
(
SNodeMsg
));
if
(
pMsg
==
NULL
)
{
if
(
pMsg
==
NULL
)
{
...
@@ -90,11 +94,21 @@ int32_t mmPutMsgToReadQueue(SMgmtWrapper *pWrapper, SRpcMsg *pRpc) {
...
@@ -90,11 +94,21 @@ int32_t mmPutMsgToReadQueue(SMgmtWrapper *pWrapper, SRpcMsg *pRpc) {
return
mmPutRpcMsgToWorker
(
pMgmt
,
&
pMgmt
->
readWorker
,
pRpc
);
return
mmPutRpcMsgToWorker
(
pMgmt
,
&
pMgmt
->
readWorker
,
pRpc
);
}
}
int32_t
mmPutMsgToQueryQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
return
mmPutRpcMsgToWorker
(
pMgmt
,
&
pMgmt
->
queryWorker
,
pRpc
);
}
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
)
{
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
)
{
SSingleWorkerCfg
cfg
=
{.
minNum
=
0
,
.
maxNum
=
1
,
.
name
=
"mnode-read"
,
.
fp
=
(
FItem
)
mmProcessQueue
,
.
param
=
pMgmt
};
SSingleWorkerCfg
cfg
=
{.
minNum
=
0
,
.
maxNum
=
1
,
.
name
=
"mnode-read"
,
.
fp
=
(
FItem
)
mmProcessQueue
,
.
param
=
pMgmt
};
SSingleWorkerCfg
readCfg
=
{.
minNum
=
2
,
.
maxNum
=
2
,
.
name
=
"mnode-read"
,
.
fp
=
(
FItem
)
mmProcessQueue
,
.
param
=
pMgmt
};
if
(
tSingleWorkerInit
(
&
pMgmt
->
readWorker
,
&
readCfg
)
!=
0
)
{
if
(
tSingleWorkerInit
(
&
pMgmt
->
queryWorker
,
&
cfg
)
!=
0
)
{
dError
(
"failed to start mnode-query worker since %s"
,
terrstr
());
return
-
1
;
}
if
(
tSingleWorkerInit
(
&
pMgmt
->
readWorker
,
&
cfg
)
!=
0
)
{
dError
(
"failed to start mnode-read worker since %s"
,
terrstr
());
dError
(
"failed to start mnode-read worker since %s"
,
terrstr
());
return
-
1
;
return
-
1
;
}
}
...
@@ -115,6 +129,7 @@ int32_t mmStartWorker(SMnodeMgmt *pMgmt) {
...
@@ -115,6 +129,7 @@ int32_t mmStartWorker(SMnodeMgmt *pMgmt) {
void
mmStopWorker
(
SMnodeMgmt
*
pMgmt
)
{
void
mmStopWorker
(
SMnodeMgmt
*
pMgmt
)
{
tSingleWorkerCleanup
(
&
pMgmt
->
readWorker
);
tSingleWorkerCleanup
(
&
pMgmt
->
readWorker
);
tSingleWorkerCleanup
(
&
pMgmt
->
queryWorker
);
tSingleWorkerCleanup
(
&
pMgmt
->
writeWorker
);
tSingleWorkerCleanup
(
&
pMgmt
->
writeWorker
);
tSingleWorkerCleanup
(
&
pMgmt
->
syncWorker
);
tSingleWorkerCleanup
(
&
pMgmt
->
syncWorker
);
dDebug
(
"mnode workers are closed"
);
dDebug
(
"mnode workers are closed"
);
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
e18d7de9
...
@@ -80,7 +80,7 @@ static void mndCalMqRebalance(void *param, void *tmrId) {
...
@@ -80,7 +80,7 @@ static void mndCalMqRebalance(void *param, void *tmrId) {
.
pCont
=
pReq
,
.
pCont
=
pReq
,
.
contLen
=
contLen
,
.
contLen
=
contLen
,
};
};
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
QUERY
_QUEUE
,
&
rpcMsg
);
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
READ
_QUEUE
,
&
rpcMsg
);
}
}
taosTmrReset
(
mndCalMqRebalance
,
MQ_TIMER_MS
,
pMnode
,
pMnode
->
timer
,
&
pMnode
->
mqTimer
);
taosTmrReset
(
mndCalMqRebalance
,
MQ_TIMER_MS
,
pMnode
,
pMnode
->
timer
,
&
pMnode
->
mqTimer
);
...
@@ -92,7 +92,7 @@ static void mndPullupTelem(void *param, void *tmrId) {
...
@@ -92,7 +92,7 @@ static void mndPullupTelem(void *param, void *tmrId) {
int32_t
contLen
=
0
;
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_MND_TELEM_TIMER
,
.
pCont
=
pReq
,
.
contLen
=
contLen
};
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_MND_TELEM_TIMER
,
.
pCont
=
pReq
,
.
contLen
=
contLen
};
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
QUERY
_QUEUE
,
&
rpcMsg
);
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
READ
_QUEUE
,
&
rpcMsg
);
}
}
taosTmrReset
(
mndPullupTelem
,
TELEM_TIMER_MS
,
pMnode
,
pMnode
->
timer
,
&
pMnode
->
telemTimer
);
taosTmrReset
(
mndPullupTelem
,
TELEM_TIMER_MS
,
pMnode
,
pMnode
->
timer
,
&
pMnode
->
telemTimer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录