Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e6a08343
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6a08343
编写于
1月 06, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
663ca79a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
28 deletion
+29
-28
source/dnode/mgmt/impl/src/dndDnode.c
source/dnode/mgmt/impl/src/dndDnode.c
+29
-28
未找到文件。
source/dnode/mgmt/impl/src/dndDnode.c
浏览文件 @
e6a08343
...
@@ -32,10 +32,10 @@ static int32_t dndReadDnodes(SDnode *pDnode);
...
@@ -32,10 +32,10 @@ static int32_t dndReadDnodes(SDnode *pDnode);
static
int32_t
dndWriteDnodes
(
SDnode
*
pDnode
);
static
int32_t
dndWriteDnodes
(
SDnode
*
pDnode
);
static
void
*
dnodeThreadRoutine
(
void
*
param
);
static
void
*
dnodeThreadRoutine
(
void
*
param
);
static
int32_t
dndProcessConfigDnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Msg
);
static
int32_t
dndProcessConfigDnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Req
);
static
void
dndProcessStatusRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Msg
);
static
void
dndProcessStatusRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Rsp
);
static
void
dndProcessAuthRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Msg
);
static
void
dndProcessAuthRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Rsp
);
static
void
dndProcessGrantRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Msg
);
static
void
dndProcessGrantRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Rsp
);
int32_t
dndGetDnodeId
(
SDnode
*
pDnode
)
{
int32_t
dndGetDnodeId
(
SDnode
*
pDnode
)
{
SDnodeMgmt
*
pMgmt
=
&
pDnode
->
dmgmt
;
SDnodeMgmt
*
pMgmt
=
&
pDnode
->
dmgmt
;
...
@@ -80,13 +80,13 @@ void dndGetMnodeEpSet(SDnode *pDnode, SEpSet *pEpSet) {
...
@@ -80,13 +80,13 @@ void dndGetMnodeEpSet(SDnode *pDnode, SEpSet *pEpSet) {
taosRUnLockLatch
(
&
pMgmt
->
latch
);
taosRUnLockLatch
(
&
pMgmt
->
latch
);
}
}
void
dndSendRedirectRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Msg
)
{
void
dndSendRedirectRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Req
)
{
tmsg_t
msgType
=
p
Msg
->
msgType
;
tmsg_t
msgType
=
p
Req
->
msgType
;
SEpSet
epSet
=
{
0
};
SEpSet
epSet
=
{
0
};
dndGetMnodeEpSet
(
pDnode
,
&
epSet
);
dndGetMnodeEpSet
(
pDnode
,
&
epSet
);
dDebug
(
"RPC %p,
msg:%s is redirected, num:%d use:%d"
,
pMsg
->
handle
,
TMSG_INFO
(
msgType
),
epSet
.
numOfEps
,
epSet
.
inUse
);
dDebug
(
"RPC %p,
req:%s is redirected, num:%d use:%d"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
epSet
.
numOfEps
,
epSet
.
inUse
);
for
(
int32_t
i
=
0
;
i
<
epSet
.
numOfEps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
epSet
.
numOfEps
;
++
i
)
{
dDebug
(
"mnode index:%d %s:%u"
,
i
,
epSet
.
fqdn
[
i
],
epSet
.
port
[
i
]);
dDebug
(
"mnode index:%d %s:%u"
,
i
,
epSet
.
fqdn
[
i
],
epSet
.
port
[
i
]);
if
(
strcmp
(
epSet
.
fqdn
[
i
],
pDnode
->
opt
.
localFqdn
)
==
0
&&
epSet
.
port
[
i
]
==
pDnode
->
opt
.
serverPort
)
{
if
(
strcmp
(
epSet
.
fqdn
[
i
],
pDnode
->
opt
.
localFqdn
)
==
0
&&
epSet
.
port
[
i
]
==
pDnode
->
opt
.
serverPort
)
{
...
@@ -96,7 +96,7 @@ void dndSendRedirectRsp(SDnode *pDnode, SRpcMsg *pMsg) {
...
@@ -96,7 +96,7 @@ void dndSendRedirectRsp(SDnode *pDnode, SRpcMsg *pMsg) {
epSet
.
port
[
i
]
=
htons
(
epSet
.
port
[
i
]);
epSet
.
port
[
i
]
=
htons
(
epSet
.
port
[
i
]);
}
}
rpcSendRedirectRsp
(
p
Msg
->
handle
,
&
epSet
);
rpcSendRedirectRsp
(
p
Req
->
handle
,
&
epSet
);
}
}
static
void
dndUpdateMnodeEpSet
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
)
{
static
void
dndUpdateMnodeEpSet
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
)
{
...
@@ -391,7 +391,7 @@ void dndSendStatusReq(SDnode *pDnode) {
...
@@ -391,7 +391,7 @@ void dndSendStatusReq(SDnode *pDnode) {
SRpcMsg
rpcMsg
=
{.
pCont
=
pStatus
,
.
contLen
=
contLen
,
.
msgType
=
TDMT_MND_STATUS
,
.
ahandle
=
(
void
*
)
9527
};
SRpcMsg
rpcMsg
=
{.
pCont
=
pStatus
,
.
contLen
=
contLen
,
.
msgType
=
TDMT_MND_STATUS
,
.
ahandle
=
(
void
*
)
9527
};
pMgmt
->
statusSent
=
1
;
pMgmt
->
statusSent
=
1
;
dTrace
(
"pDnode:%p, send status
msg
to mnode"
,
pDnode
);
dTrace
(
"pDnode:%p, send status
req
to mnode"
,
pDnode
);
dndSendReqToMnode
(
pDnode
,
&
rpcMsg
);
dndSendReqToMnode
(
pDnode
,
&
rpcMsg
);
}
}
...
@@ -427,12 +427,12 @@ static void dndUpdateDnodeEps(SDnode *pDnode, SDnodeEps *pDnodeEps) {
...
@@ -427,12 +427,12 @@ static void dndUpdateDnodeEps(SDnode *pDnode, SDnodeEps *pDnodeEps) {
taosWUnLockLatch
(
&
pMgmt
->
latch
);
taosWUnLockLatch
(
&
pMgmt
->
latch
);
}
}
static
void
dndProcessStatusRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Msg
)
{
static
void
dndProcessStatusRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Rsp
)
{
SDnodeMgmt
*
pMgmt
=
&
pDnode
->
dmgmt
;
SDnodeMgmt
*
pMgmt
=
&
pDnode
->
dmgmt
;
if
(
p
Msg
->
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
p
Rsp
->
code
!=
TSDB_CODE_SUCCESS
)
{
pMgmt
->
statusSent
=
0
;
pMgmt
->
statusSent
=
0
;
if
(
p
Msg
->
code
==
TSDB_CODE_MND_DNODE_NOT_EXIST
&&
!
pMgmt
->
dropped
&&
pMgmt
->
dnodeId
>
0
)
{
if
(
p
Rsp
->
code
==
TSDB_CODE_MND_DNODE_NOT_EXIST
&&
!
pMgmt
->
dropped
&&
pMgmt
->
dnodeId
>
0
)
{
dInfo
(
"dnode:%d, set to dropped since not exist in mnode"
,
pMgmt
->
dnodeId
);
dInfo
(
"dnode:%d, set to dropped since not exist in mnode"
,
pMgmt
->
dnodeId
);
pMgmt
->
dropped
=
1
;
pMgmt
->
dropped
=
1
;
dndWriteDnodes
(
pDnode
);
dndWriteDnodes
(
pDnode
);
...
@@ -440,16 +440,16 @@ static void dndProcessStatusRsp(SDnode *pDnode, SRpcMsg *pMsg) {
...
@@ -440,16 +440,16 @@ static void dndProcessStatusRsp(SDnode *pDnode, SRpcMsg *pMsg) {
return
;
return
;
}
}
SStatusRsp
*
pRsp
=
pMsg
->
pCont
;
if
(
pRsp
->
pCont
!=
NULL
&&
pRsp
->
contLen
!=
0
)
{
if
(
pMsg
->
pCont
!=
NULL
&&
pMsg
->
contLen
!=
0
)
{
SStatusRsp
*
pStatus
=
pRsp
->
pCont
;
pMgmt
->
dver
=
htobe64
(
p
Rsp
->
dver
);
pMgmt
->
dver
=
htobe64
(
p
Status
->
dver
);
SDnodeCfg
*
pCfg
=
&
p
Rsp
->
dnodeCfg
;
SDnodeCfg
*
pCfg
=
&
p
Status
->
dnodeCfg
;
pCfg
->
dnodeId
=
htonl
(
pCfg
->
dnodeId
);
pCfg
->
dnodeId
=
htonl
(
pCfg
->
dnodeId
);
pCfg
->
clusterId
=
htobe64
(
pCfg
->
clusterId
);
pCfg
->
clusterId
=
htobe64
(
pCfg
->
clusterId
);
dndUpdateDnodeCfg
(
pDnode
,
pCfg
);
dndUpdateDnodeCfg
(
pDnode
,
pCfg
);
SDnodeEps
*
pDnodeEps
=
&
p
Rsp
->
dnodeEps
;
SDnodeEps
*
pDnodeEps
=
&
p
Status
->
dnodeEps
;
pDnodeEps
->
num
=
htonl
(
pDnodeEps
->
num
);
pDnodeEps
->
num
=
htonl
(
pDnodeEps
->
num
);
for
(
int32_t
i
=
0
;
i
<
pDnodeEps
->
num
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pDnodeEps
->
num
;
++
i
)
{
pDnodeEps
->
eps
[
i
].
id
=
htonl
(
pDnodeEps
->
eps
[
i
].
id
);
pDnodeEps
->
eps
[
i
].
id
=
htonl
(
pDnodeEps
->
eps
[
i
].
id
);
...
@@ -461,26 +461,27 @@ static void dndProcessStatusRsp(SDnode *pDnode, SRpcMsg *pMsg) {
...
@@ -461,26 +461,27 @@ static void dndProcessStatusRsp(SDnode *pDnode, SRpcMsg *pMsg) {
pMgmt
->
statusSent
=
0
;
pMgmt
->
statusSent
=
0
;
}
}
static
void
dndProcessAuthRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Msg
)
{
assert
(
1
);
}
static
void
dndProcessAuthRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Req
)
{
dError
(
"auth rsp is received, but not supported yet"
);
}
static
void
dndProcessGrantRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
)
{
assert
(
1
);
}
static
void
dndProcessGrantRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
dError
(
"grant rsp is received, but not supported yet"
);
static
int32_t
dndProcessConfigDnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
)
{
}
dError
(
"config msg is received, but not supported yet"
);
SDCfgDnodeReq
*
pCfg
=
pMsg
->
pCont
;
static
int32_t
dndProcessConfigDnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
dError
(
"config req is received, but not supported yet"
);
SDCfgDnodeReq
*
pCfg
=
pReq
->
pCont
;
return
TSDB_CODE_OPS_NOT_SUPPORT
;
return
TSDB_CODE_OPS_NOT_SUPPORT
;
}
}
void
dndProcessStartupReq
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Msg
)
{
void
dndProcessStartupReq
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Req
)
{
dDebug
(
"startup
msg
is received"
);
dDebug
(
"startup
req
is received"
);
SStartupMsg
*
pStartup
=
rpcMallocCont
(
sizeof
(
SStartupMsg
));
SStartupMsg
*
pStartup
=
rpcMallocCont
(
sizeof
(
SStartupMsg
));
dndGetStartup
(
pDnode
,
pStartup
);
dndGetStartup
(
pDnode
,
pStartup
);
dDebug
(
"startup
msg
is sent, step:%s desc:%s finished:%d"
,
pStartup
->
name
,
pStartup
->
desc
,
pStartup
->
finished
);
dDebug
(
"startup
req
is sent, step:%s desc:%s finished:%d"
,
pStartup
->
name
,
pStartup
->
desc
,
pStartup
->
finished
);
SRpcMsg
rpcRsp
=
{.
handle
=
p
Msg
->
handle
,
.
pCont
=
pStartup
,
.
contLen
=
sizeof
(
SStartupMsg
)};
SRpcMsg
rpcRsp
=
{.
handle
=
p
Req
->
handle
,
.
pCont
=
pStartup
,
.
contLen
=
sizeof
(
SStartupMsg
)};
rpcSendResponse
(
&
rpcRsp
);
rpcSendResponse
(
&
rpcRsp
);
}
}
...
@@ -707,7 +708,7 @@ static void dndProcessMgmtQueue(SDnode *pDnode, SRpcMsg *pMsg) {
...
@@ -707,7 +708,7 @@ static void dndProcessMgmtQueue(SDnode *pDnode, SRpcMsg *pMsg) {
default:
default:
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
code
=
-
1
;
code
=
-
1
;
dError
(
"RPC %p, dnode
req
:%s not processed"
,
pMsg
->
handle
,
TMSG_INFO
(
pMsg
->
msgType
));
dError
(
"RPC %p, dnode
msg
:%s not processed"
,
pMsg
->
handle
,
TMSG_INFO
(
pMsg
->
msgType
));
break
;
break
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录