Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cdfb47cb
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1191
Star
22018
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看板
提交
cdfb47cb
编写于
6月 25, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: check oper privilege
上级
e3698b0b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
59 addition
and
64 deletion
+59
-64
source/dnode/mnode/impl/inc/mndAuth.h
source/dnode/mnode/impl/inc/mndAuth.h
+2
-0
source/dnode/mnode/impl/src/mndBnode.c
source/dnode/mnode/impl/src/mndBnode.c
+6
-8
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+10
-9
source/dnode/mnode/impl/src/mndFunc.c
source/dnode/mnode/impl/src/mndFunc.c
+6
-8
source/dnode/mnode/impl/src/mndMnode.c
source/dnode/mnode/impl/src/mndMnode.c
+7
-9
source/dnode/mnode/impl/src/mndQnode.c
source/dnode/mnode/impl/src/mndQnode.c
+13
-16
source/dnode/mnode/impl/src/mndSnode.c
source/dnode/mnode/impl/src/mndSnode.c
+6
-8
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+9
-6
未找到文件。
source/dnode/mnode/impl/inc/mndAuth.h
浏览文件 @
cdfb47cb
...
@@ -31,6 +31,7 @@ typedef enum {
...
@@ -31,6 +31,7 @@ typedef enum {
MND_OPER_DROP_BNODE
,
MND_OPER_DROP_BNODE
,
MND_OPER_CREATE_DNODE
,
MND_OPER_CREATE_DNODE
,
MND_OPER_DROP_DNODE
,
MND_OPER_DROP_DNODE
,
MND_OPER_CONFIG_DNODE
,
MND_OPER_CREATE_MNODE
,
MND_OPER_CREATE_MNODE
,
MND_OPER_DROP_MNODE
,
MND_OPER_DROP_MNODE
,
MND_OPER_CREATE_QNODE
,
MND_OPER_CREATE_QNODE
,
...
@@ -38,6 +39,7 @@ typedef enum {
...
@@ -38,6 +39,7 @@ typedef enum {
MND_OPER_CREATE_SNODE
,
MND_OPER_CREATE_SNODE
,
MND_OPER_DROP_SNODE
,
MND_OPER_DROP_SNODE
,
MND_OPER_REDISTRIBUTE_VGROUP
,
MND_OPER_REDISTRIBUTE_VGROUP
,
MND_OPER_MERGE_VGROUP
,
MND_OPER_SPLIT_VGROUP
,
MND_OPER_SPLIT_VGROUP
,
MND_OPER_BALANCE_VGROUP
,
MND_OPER_BALANCE_VGROUP
,
MND_OPER_CREATE_FUNC
,
MND_OPER_CREATE_FUNC
,
...
...
source/dnode/mnode/impl/src/mndBnode.c
浏览文件 @
cdfb47cb
...
@@ -277,6 +277,9 @@ static int32_t mndProcessCreateBnodeReq(SRpcMsg *pReq) {
...
@@ -277,6 +277,9 @@ static int32_t mndProcessCreateBnodeReq(SRpcMsg *pReq) {
}
}
mDebug
(
"bnode:%d, start to create"
,
createReq
.
dnodeId
);
mDebug
(
"bnode:%d, start to create"
,
createReq
.
dnodeId
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_BNODE
)
!=
0
)
{
goto
_OVER
;
}
pObj
=
mndAcquireBnode
(
pMnode
,
createReq
.
dnodeId
);
pObj
=
mndAcquireBnode
(
pMnode
,
createReq
.
dnodeId
);
if
(
pObj
!=
NULL
)
{
if
(
pObj
!=
NULL
)
{
...
@@ -292,10 +295,6 @@ static int32_t mndProcessCreateBnodeReq(SRpcMsg *pReq) {
...
@@ -292,10 +295,6 @@ static int32_t mndProcessCreateBnodeReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_BNODE
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndCreateBnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
code
=
mndCreateBnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -383,6 +382,9 @@ static int32_t mndProcessDropBnodeReq(SRpcMsg *pReq) {
...
@@ -383,6 +382,9 @@ static int32_t mndProcessDropBnodeReq(SRpcMsg *pReq) {
}
}
mDebug
(
"bnode:%d, start to drop"
,
dropReq
.
dnodeId
);
mDebug
(
"bnode:%d, start to drop"
,
dropReq
.
dnodeId
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_BNODE
)
!=
0
)
{
goto
_OVER
;
}
if
(
dropReq
.
dnodeId
<=
0
)
{
if
(
dropReq
.
dnodeId
<=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
...
@@ -394,10 +396,6 @@ static int32_t mndProcessDropBnodeReq(SRpcMsg *pReq) {
...
@@ -394,10 +396,6 @@ static int32_t mndProcessDropBnodeReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_BNODE
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndDropBnode
(
pMnode
,
pReq
,
pObj
);
code
=
mndDropBnode
(
pMnode
,
pReq
,
pObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
cdfb47cb
...
@@ -609,7 +609,6 @@ _OVER:
...
@@ -609,7 +609,6 @@ _OVER:
return
code
;
return
code
;
}
}
static
int32_t
mndProcessCreateDnodeReq
(
SRpcMsg
*
pReq
)
{
static
int32_t
mndProcessCreateDnodeReq
(
SRpcMsg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SMnode
*
pMnode
=
pReq
->
info
.
node
;
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
...
@@ -622,6 +621,9 @@ static int32_t mndProcessCreateDnodeReq(SRpcMsg *pReq) {
...
@@ -622,6 +621,9 @@ static int32_t mndProcessCreateDnodeReq(SRpcMsg *pReq) {
}
}
mInfo
(
"dnode:%s:%d, start to create"
,
createReq
.
fqdn
,
createReq
.
port
);
mInfo
(
"dnode:%s:%d, start to create"
,
createReq
.
fqdn
,
createReq
.
port
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_DNODE
)
!=
0
)
{
goto
_OVER
;
}
if
(
createReq
.
fqdn
[
0
]
==
0
||
createReq
.
port
<=
0
||
createReq
.
port
>
UINT16_MAX
)
{
if
(
createReq
.
fqdn
[
0
]
==
0
||
createReq
.
port
<=
0
||
createReq
.
port
>
UINT16_MAX
)
{
terrno
=
TSDB_CODE_MND_INVALID_DNODE_EP
;
terrno
=
TSDB_CODE_MND_INVALID_DNODE_EP
;
...
@@ -635,10 +637,6 @@ static int32_t mndProcessCreateDnodeReq(SRpcMsg *pReq) {
...
@@ -635,10 +637,6 @@ static int32_t mndProcessCreateDnodeReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_DNODE
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndCreateDnode
(
pMnode
,
pReq
,
&
createReq
);
code
=
mndCreateDnode
(
pMnode
,
pReq
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -717,6 +715,9 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
...
@@ -717,6 +715,9 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
}
}
mInfo
(
"dnode:%d, start to drop, ep:%s:%d"
,
dropReq
.
dnodeId
,
dropReq
.
fqdn
,
dropReq
.
port
);
mInfo
(
"dnode:%d, start to drop, ep:%s:%d"
,
dropReq
.
dnodeId
,
dropReq
.
fqdn
,
dropReq
.
port
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_MNODE
)
!=
0
)
{
goto
_OVER
;
}
pDnode
=
mndAcquireDnode
(
pMnode
,
dropReq
.
dnodeId
);
pDnode
=
mndAcquireDnode
(
pMnode
,
dropReq
.
dnodeId
);
if
(
pDnode
==
NULL
)
{
if
(
pDnode
==
NULL
)
{
...
@@ -753,10 +754,6 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
...
@@ -753,10 +754,6 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
}
}
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_MNODE
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndDropDnode
(
pMnode
,
pReq
,
pDnode
,
pMObj
,
pQObj
,
pSObj
,
numOfVnodes
);
code
=
mndDropDnode
(
pMnode
,
pReq
,
pDnode
,
pMObj
,
pQObj
,
pSObj
,
numOfVnodes
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -782,6 +779,10 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
...
@@ -782,6 +779,10 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
}
}
mInfo
(
"dnode:%d, start to config, option:%s, value:%s"
,
cfgReq
.
dnodeId
,
cfgReq
.
config
,
cfgReq
.
value
);
mInfo
(
"dnode:%d, start to config, option:%s, value:%s"
,
cfgReq
.
dnodeId
,
cfgReq
.
config
,
cfgReq
.
value
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CONFIG_DNODE
)
!=
0
)
{
return
-
1
;
}
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
cfgReq
.
dnodeId
);
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
cfgReq
.
dnodeId
);
if
(
pDnode
==
NULL
)
{
if
(
pDnode
==
NULL
)
{
mError
(
"dnode:%d, failed to config since %s "
,
cfgReq
.
dnodeId
,
terrstr
());
mError
(
"dnode:%d, failed to config since %s "
,
cfgReq
.
dnodeId
,
terrstr
());
...
...
source/dnode/mnode/impl/src/mndFunc.c
浏览文件 @
cdfb47cb
...
@@ -283,6 +283,9 @@ static int32_t mndProcessCreateFuncReq(SRpcMsg *pReq) {
...
@@ -283,6 +283,9 @@ static int32_t mndProcessCreateFuncReq(SRpcMsg *pReq) {
}
}
mDebug
(
"func:%s, start to create"
,
createReq
.
name
);
mDebug
(
"func:%s, start to create"
,
createReq
.
name
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_FUNC
)
!=
0
)
{
goto
_OVER
;
}
pFunc
=
mndAcquireFunc
(
pMnode
,
createReq
.
name
);
pFunc
=
mndAcquireFunc
(
pMnode
,
createReq
.
name
);
if
(
pFunc
!=
NULL
)
{
if
(
pFunc
!=
NULL
)
{
...
@@ -318,10 +321,6 @@ static int32_t mndProcessCreateFuncReq(SRpcMsg *pReq) {
...
@@ -318,10 +321,6 @@ static int32_t mndProcessCreateFuncReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_FUNC
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndCreateFunc
(
pMnode
,
pReq
,
&
createReq
);
code
=
mndCreateFunc
(
pMnode
,
pReq
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -347,6 +346,9 @@ static int32_t mndProcessDropFuncReq(SRpcMsg *pReq) {
...
@@ -347,6 +346,9 @@ static int32_t mndProcessDropFuncReq(SRpcMsg *pReq) {
}
}
mDebug
(
"func:%s, start to drop"
,
dropReq
.
name
);
mDebug
(
"func:%s, start to drop"
,
dropReq
.
name
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_FUNC
)
!=
0
)
{
goto
_OVER
;
}
if
(
dropReq
.
name
[
0
]
==
0
)
{
if
(
dropReq
.
name
[
0
]
==
0
)
{
terrno
=
TSDB_CODE_MND_INVALID_FUNC_NAME
;
terrno
=
TSDB_CODE_MND_INVALID_FUNC_NAME
;
...
@@ -365,10 +367,6 @@ static int32_t mndProcessDropFuncReq(SRpcMsg *pReq) {
...
@@ -365,10 +367,6 @@ static int32_t mndProcessDropFuncReq(SRpcMsg *pReq) {
}
}
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_FUNC
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndDropFunc
(
pMnode
,
pReq
,
pFunc
);
code
=
mndDropFunc
(
pMnode
,
pReq
,
pFunc
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
...
source/dnode/mnode/impl/src/mndMnode.c
浏览文件 @
cdfb47cb
...
@@ -389,6 +389,9 @@ static int32_t mndProcessCreateMnodeReq(SRpcMsg *pReq) {
...
@@ -389,6 +389,9 @@ static int32_t mndProcessCreateMnodeReq(SRpcMsg *pReq) {
}
}
mDebug
(
"mnode:%d, start to create"
,
createReq
.
dnodeId
);
mDebug
(
"mnode:%d, start to create"
,
createReq
.
dnodeId
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_MNODE
)
!=
0
)
{
goto
_OVER
;
}
pObj
=
mndAcquireMnode
(
pMnode
,
createReq
.
dnodeId
);
pObj
=
mndAcquireMnode
(
pMnode
,
createReq
.
dnodeId
);
if
(
pObj
!=
NULL
)
{
if
(
pObj
!=
NULL
)
{
...
@@ -414,10 +417,6 @@ static int32_t mndProcessCreateMnodeReq(SRpcMsg *pReq) {
...
@@ -414,10 +417,6 @@ static int32_t mndProcessCreateMnodeReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_MNODE
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndCreateMnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
code
=
mndCreateMnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -495,7 +494,7 @@ static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnode
...
@@ -495,7 +494,7 @@ static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnode
{
{
int32_t
contLen
=
tSerializeSSetStandbyReq
(
NULL
,
0
,
&
standbyReq
)
+
sizeof
(
SMsgHead
);
int32_t
contLen
=
tSerializeSSetStandbyReq
(
NULL
,
0
,
&
standbyReq
)
+
sizeof
(
SMsgHead
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
tSerializeSSetStandbyReq
((
char
*
)
pReq
+
sizeof
(
SMsgHead
),
contLen
,
&
standbyReq
);
tSerializeSSetStandbyReq
((
char
*
)
pReq
+
sizeof
(
SMsgHead
),
contLen
,
&
standbyReq
);
SMsgHead
*
pHead
=
pReq
;
SMsgHead
*
pHead
=
pReq
;
pHead
->
contLen
=
htonl
(
contLen
);
pHead
->
contLen
=
htonl
(
contLen
);
pHead
->
vgId
=
htonl
(
MNODE_HANDLE
);
pHead
->
vgId
=
htonl
(
MNODE_HANDLE
);
...
@@ -595,6 +594,9 @@ static int32_t mndProcessDropMnodeReq(SRpcMsg *pReq) {
...
@@ -595,6 +594,9 @@ static int32_t mndProcessDropMnodeReq(SRpcMsg *pReq) {
}
}
mDebug
(
"mnode:%d, start to drop"
,
dropReq
.
dnodeId
);
mDebug
(
"mnode:%d, start to drop"
,
dropReq
.
dnodeId
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_MNODE
)
!=
0
)
{
goto
_OVER
;
}
if
(
dropReq
.
dnodeId
<=
0
)
{
if
(
dropReq
.
dnodeId
<=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
...
@@ -621,10 +623,6 @@ static int32_t mndProcessDropMnodeReq(SRpcMsg *pReq) {
...
@@ -621,10 +623,6 @@ static int32_t mndProcessDropMnodeReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_MNODE
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndDropMnode
(
pMnode
,
pReq
,
pObj
);
code
=
mndDropMnode
(
pMnode
,
pReq
,
pObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
...
source/dnode/mnode/impl/src/mndQnode.c
浏览文件 @
cdfb47cb
...
@@ -279,6 +279,9 @@ static int32_t mndProcessCreateQnodeReq(SRpcMsg *pReq) {
...
@@ -279,6 +279,9 @@ static int32_t mndProcessCreateQnodeReq(SRpcMsg *pReq) {
}
}
mDebug
(
"qnode:%d, start to create"
,
createReq
.
dnodeId
);
mDebug
(
"qnode:%d, start to create"
,
createReq
.
dnodeId
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_QNODE
)
!=
0
)
{
goto
_OVER
;
}
pObj
=
mndAcquireQnode
(
pMnode
,
createReq
.
dnodeId
);
pObj
=
mndAcquireQnode
(
pMnode
,
createReq
.
dnodeId
);
if
(
pObj
!=
NULL
)
{
if
(
pObj
!=
NULL
)
{
...
@@ -294,10 +297,6 @@ static int32_t mndProcessCreateQnodeReq(SRpcMsg *pReq) {
...
@@ -294,10 +297,6 @@ static int32_t mndProcessCreateQnodeReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_QNODE
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndCreateQnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
code
=
mndCreateQnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -391,6 +390,9 @@ static int32_t mndProcessDropQnodeReq(SRpcMsg *pReq) {
...
@@ -391,6 +390,9 @@ static int32_t mndProcessDropQnodeReq(SRpcMsg *pReq) {
}
}
mDebug
(
"qnode:%d, start to drop"
,
dropReq
.
dnodeId
);
mDebug
(
"qnode:%d, start to drop"
,
dropReq
.
dnodeId
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_QNODE
)
!=
0
)
{
goto
_OVER
;
}
if
(
dropReq
.
dnodeId
<=
0
)
{
if
(
dropReq
.
dnodeId
<=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
...
@@ -402,10 +404,6 @@ static int32_t mndProcessDropQnodeReq(SRpcMsg *pReq) {
...
@@ -402,10 +404,6 @@ static int32_t mndProcessDropQnodeReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_QNODE
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndDropQnode
(
pMnode
,
pReq
,
pObj
);
code
=
mndDropQnode
(
pMnode
,
pReq
,
pObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -418,19 +416,19 @@ _OVER:
...
@@ -418,19 +416,19 @@ _OVER:
return
code
;
return
code
;
}
}
int32_t
mndCreateQnodeList
(
SMnode
*
pMnode
,
SArray
**
pList
,
int32_t
limit
)
{
int32_t
mndCreateQnodeList
(
SMnode
*
pMnode
,
SArray
**
pList
,
int32_t
limit
)
{
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
void
*
pIter
=
NULL
;
void
*
pIter
=
NULL
;
SQnodeObj
*
pObj
=
NULL
;
SQnodeObj
*
pObj
=
NULL
;
int32_t
numOfRows
=
0
;
int32_t
numOfRows
=
0
;
SArray
*
qnodeList
=
taosArrayInit
(
5
,
sizeof
(
SQueryNodeLoad
));
SArray
*
qnodeList
=
taosArrayInit
(
5
,
sizeof
(
SQueryNodeLoad
));
if
(
NULL
==
qnodeList
)
{
if
(
NULL
==
qnodeList
)
{
mError
(
"failed to alloc epSet while process qnode list req"
);
mError
(
"failed to alloc epSet while process qnode list req"
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
terrno
;
return
terrno
;
}
}
while
(
1
)
{
while
(
1
)
{
pIter
=
sdbFetch
(
pSdb
,
SDB_QNODE
,
pIter
,
(
void
**
)
&
pObj
);
pIter
=
sdbFetch
(
pSdb
,
SDB_QNODE
,
pIter
,
(
void
**
)
&
pObj
);
if
(
pIter
==
NULL
)
break
;
if
(
pIter
==
NULL
)
break
;
...
@@ -457,7 +455,6 @@ int32_t mndCreateQnodeList(SMnode *pMnode, SArray** pList, int32_t limit)
...
@@ -457,7 +455,6 @@ int32_t mndCreateQnodeList(SMnode *pMnode, SArray** pList, int32_t limit)
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
mndProcessQnodeListReq
(
SRpcMsg
*
pReq
)
{
static
int32_t
mndProcessQnodeListReq
(
SRpcMsg
*
pReq
)
{
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SMnode
*
pMnode
=
pReq
->
info
.
node
;
...
...
source/dnode/mnode/impl/src/mndSnode.c
浏览文件 @
cdfb47cb
...
@@ -285,6 +285,9 @@ static int32_t mndProcessCreateSnodeReq(SRpcMsg *pReq) {
...
@@ -285,6 +285,9 @@ static int32_t mndProcessCreateSnodeReq(SRpcMsg *pReq) {
}
}
mDebug
(
"snode:%d, start to create"
,
createReq
.
dnodeId
);
mDebug
(
"snode:%d, start to create"
,
createReq
.
dnodeId
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_SNODE
)
!=
0
)
{
goto
_OVER
;
}
pObj
=
mndAcquireSnode
(
pMnode
,
createReq
.
dnodeId
);
pObj
=
mndAcquireSnode
(
pMnode
,
createReq
.
dnodeId
);
if
(
pObj
!=
NULL
)
{
if
(
pObj
!=
NULL
)
{
...
@@ -300,10 +303,6 @@ static int32_t mndProcessCreateSnodeReq(SRpcMsg *pReq) {
...
@@ -300,10 +303,6 @@ static int32_t mndProcessCreateSnodeReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_CREATE_SNODE
)
!=
0
)
{
goto
_OVER
;
}
code
=
mndCreateSnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
code
=
mndCreateSnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -398,6 +397,9 @@ static int32_t mndProcessDropSnodeReq(SRpcMsg *pReq) {
...
@@ -398,6 +397,9 @@ static int32_t mndProcessDropSnodeReq(SRpcMsg *pReq) {
}
}
mDebug
(
"snode:%d, start to drop"
,
dropReq
.
dnodeId
);
mDebug
(
"snode:%d, start to drop"
,
dropReq
.
dnodeId
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_SNODE
)
!=
0
)
{
goto
_OVER
;
}
if
(
dropReq
.
dnodeId
<=
0
)
{
if
(
dropReq
.
dnodeId
<=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
...
@@ -409,10 +411,6 @@ static int32_t mndProcessDropSnodeReq(SRpcMsg *pReq) {
...
@@ -409,10 +411,6 @@ static int32_t mndProcessDropSnodeReq(SRpcMsg *pReq) {
goto
_OVER
;
goto
_OVER
;
}
}
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_DROP_SNODE
)
!=
0
)
{
goto
_OVER
;
}
// check deletable
// check deletable
code
=
mndDropSnode
(
pMnode
,
pReq
,
pObj
);
code
=
mndDropSnode
(
pMnode
,
pReq
,
pObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
cdfb47cb
...
@@ -1212,8 +1212,9 @@ static int32_t mndProcessRedistributeVgroupMsg(SRpcMsg *pReq) {
...
@@ -1212,8 +1212,9 @@ static int32_t mndProcessRedistributeVgroupMsg(SRpcMsg *pReq) {
}
}
mInfo
(
"vgId:%d, start to redistribute vgroup to dnode %d:%d:%d"
,
req
.
vgId
,
req
.
dnodeId1
,
req
.
dnodeId2
,
req
.
dnodeId3
);
mInfo
(
"vgId:%d, start to redistribute vgroup to dnode %d:%d:%d"
,
req
.
vgId
,
req
.
dnodeId1
,
req
.
dnodeId2
,
req
.
dnodeId3
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_REDISTRIBUTE_VGROUP
)
!=
0
)
{
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_REDISTRIBUTE_VGROUP
)
!=
0
)
goto
_OVER
;
goto
_OVER
;
}
pVgroup
=
mndAcquireVgroup
(
pMnode
,
req
.
vgId
);
pVgroup
=
mndAcquireVgroup
(
pMnode
,
req
.
vgId
);
if
(
pVgroup
==
NULL
)
goto
_OVER
;
if
(
pVgroup
==
NULL
)
goto
_OVER
;
...
@@ -1506,6 +1507,9 @@ static int32_t mndProcessSplitVgroupMsg(SRpcMsg *pReq) {
...
@@ -1506,6 +1507,9 @@ static int32_t mndProcessSplitVgroupMsg(SRpcMsg *pReq) {
SDbObj
*
pDb
=
NULL
;
SDbObj
*
pDb
=
NULL
;
mDebug
(
"vgId:%d, start to split"
,
vgId
);
mDebug
(
"vgId:%d, start to split"
,
vgId
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_SPLIT_VGROUP
)
!=
0
)
{
goto
_OVER
;
}
pVgroup
=
mndAcquireVgroup
(
pMnode
,
vgId
);
pVgroup
=
mndAcquireVgroup
(
pMnode
,
vgId
);
if
(
pVgroup
==
NULL
)
goto
_OVER
;
if
(
pVgroup
==
NULL
)
goto
_OVER
;
...
@@ -1513,8 +1517,6 @@ static int32_t mndProcessSplitVgroupMsg(SRpcMsg *pReq) {
...
@@ -1513,8 +1517,6 @@ static int32_t mndProcessSplitVgroupMsg(SRpcMsg *pReq) {
pDb
=
mndAcquireDb
(
pMnode
,
pVgroup
->
dbName
);
pDb
=
mndAcquireDb
(
pMnode
,
pVgroup
->
dbName
);
if
(
pDb
==
NULL
)
goto
_OVER
;
if
(
pDb
==
NULL
)
goto
_OVER
;
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_SPLIT_VGROUP
)
!=
0
)
goto
_OVER
;
code
=
mndSplitVgroup
(
pMnode
,
pReq
,
pDb
,
pVgroup
);
code
=
mndSplitVgroup
(
pMnode
,
pReq
,
pDb
,
pVgroup
);
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -1655,8 +1657,9 @@ static int32_t mndProcessBalanceVgroupMsg(SRpcMsg *pReq) {
...
@@ -1655,8 +1657,9 @@ static int32_t mndProcessBalanceVgroupMsg(SRpcMsg *pReq) {
}
}
mInfo
(
"start to balance vgroup"
);
mInfo
(
"start to balance vgroup"
);
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_BALANCE_VGROUP
)
!=
0
)
{
if
(
mndCheckOperAuth
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_BALANCE_VGROUP
)
!=
0
)
goto
_OVER
;
goto
_OVER
;
}
while
(
1
)
{
while
(
1
)
{
SDnodeObj
*
pDnode
=
NULL
;
SDnodeObj
*
pDnode
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录