Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
68be5698
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看板
提交
68be5698
编写于
4月 26, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(cluster): adjust acct errno
上级
9e41cce3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
27 deletion
+12
-27
include/util/taoserror.h
include/util/taoserror.h
+3
-10
source/dnode/mnode/impl/src/mndAcct.c
source/dnode/mnode/impl/src/mndAcct.c
+3
-4
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+1
-1
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+1
-1
source/dnode/mnode/impl/test/acct/acct.cpp
source/dnode/mnode/impl/test/acct/acct.cpp
+3
-3
source/util/src/terror.c
source/util/src/terror.c
+1
-8
未找到文件。
include/util/taoserror.h
浏览文件 @
68be5698
...
...
@@ -139,16 +139,9 @@ int32_t* taosGetErrno();
// mnode-common
#define TSDB_CODE_MND_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0300)
#define TSDB_CODE_MND_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x0301)
#define TSDB_CODE_MND_MSG_NOT_PROCESSED TAOS_DEF_ERROR_CODE(0, 0x0302)
#define TSDB_CODE_MND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0303)
#define TSDB_CODE_MND_ACTION_NEED_REPROCESSED TAOS_DEF_ERROR_CODE(0, 0x0304)
#define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0305)
#define TSDB_CODE_MND_INVALID_OPTIONS TAOS_DEF_ERROR_CODE(0, 0x0306)
#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0307)
#define TSDB_CODE_MND_INVALID_MSG_VERSION TAOS_DEF_ERROR_CODE(0, 0x0308)
#define TSDB_CODE_MND_INVALID_MSG_LEN TAOS_DEF_ERROR_CODE(0, 0x0309)
#define TSDB_CODE_MND_INVALID_MSG_TYPE TAOS_DEF_ERROR_CODE(0, 0x030A)
#define TSDB_CODE_MND_TOO_MANY_SHELL_CONNS TAOS_DEF_ERROR_CODE(0, 0x030B)
#define TSDB_CODE_MND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0302)
#define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0303)
#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0304)
// mnode-show
#define TSDB_CODE_MND_INVALID_SHOWOBJ TAOS_DEF_ERROR_CODE(0, 0x0310)
...
...
source/dnode/mnode/impl/src/mndAcct.c
浏览文件 @
68be5698
...
...
@@ -179,7 +179,6 @@ static int32_t mndAcctActionDelete(SSdb *pSdb, SAcctObj *pAcct) {
static
int32_t
mndAcctActionUpdate
(
SSdb
*
pSdb
,
SAcctObj
*
pOld
,
SAcctObj
*
pNew
)
{
mTrace
(
"acct:%s, perform update action, old row:%p new row:%p"
,
pOld
->
acct
,
pOld
,
pNew
);
pOld
->
updateTime
=
pNew
->
updateTime
;
pOld
->
status
=
pNew
->
status
;
memcpy
(
&
pOld
->
cfg
,
&
pNew
->
cfg
,
sizeof
(
SAcctCfg
));
...
...
@@ -187,19 +186,19 @@ static int32_t mndAcctActionUpdate(SSdb *pSdb, SAcctObj *pOld, SAcctObj *pNew) {
}
static
int32_t
mndProcessCreateAcctReq
(
SNodeMsg
*
pReq
)
{
terrno
=
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
;
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
mError
(
"failed to process create acct request since %s"
,
terrstr
());
return
-
1
;
}
static
int32_t
mndProcessAlterAcctReq
(
SNodeMsg
*
pReq
)
{
terrno
=
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
;
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
mError
(
"failed to process create acct request since %s"
,
terrstr
());
return
-
1
;
}
static
int32_t
mndProcessDropAcctReq
(
SNodeMsg
*
pReq
)
{
terrno
=
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
;
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
mError
(
"failed to process create acct request since %s"
,
terrstr
());
return
-
1
;
}
\ No newline at end of file
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
68be5698
...
...
@@ -363,7 +363,7 @@ static int32_t mndProcessStatusReq(SNodeMsg *pReq) {
pDnode
->
offlineReason
=
DND_REASON_VERSION_NOT_MATCH
;
}
mError
(
"dnode:%d, status msg version:%d not match cluster:%d"
,
statusReq
.
dnodeId
,
statusReq
.
sver
,
tsVersion
);
terrno
=
TSDB_CODE_
MND_INVALID_MSG_VERSION
;
terrno
=
TSDB_CODE_
VERSION_NOT_COMPATIBLE
;
goto
PROCESS_STATUS_MSG_OVER
;
}
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
68be5698
...
...
@@ -368,7 +368,7 @@ int32_t mndProcessMsg(SNodeMsg *pMsg) {
}
if
(
isReq
&&
(
pRpc
->
contLen
==
0
||
pRpc
->
pCont
==
NULL
))
{
terrno
=
TSDB_CODE_
MND_
INVALID_MSG_LEN
;
terrno
=
TSDB_CODE_INVALID_MSG_LEN
;
mError
(
"msg:%p, failed to process since %s, app:%p"
,
pMsg
,
terrstr
(),
ahandle
);
return
-
1
;
}
...
...
source/dnode/mnode/impl/test/acct/acct.cpp
浏览文件 @
68be5698
...
...
@@ -32,7 +32,7 @@ TEST_F(MndTestAcct, 01_Create_Acct) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_ACCT
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_MSG_NOT_PROCESSED
);
}
TEST_F
(
MndTestAcct
,
02
_Alter_Acct
)
{
...
...
@@ -42,7 +42,7 @@ TEST_F(MndTestAcct, 02_Alter_Acct) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_ALTER_ACCT
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_MSG_NOT_PROCESSED
);
}
TEST_F
(
MndTestAcct
,
03
_Drop_Acct
)
{
...
...
@@ -52,5 +52,5 @@ TEST_F(MndTestAcct, 03_Drop_Acct) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_ACCT
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_MSG_NOT_PROCESSED
);
}
source/util/src/terror.c
浏览文件 @
68be5698
...
...
@@ -144,17 +144,10 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSC_STMT_CLAUSE_ERROR, "not supported stmt cl
// mnode-common
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_APP_ERROR
,
"Mnode internal error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NOT_READY
,
"Cluster not ready"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_MSG_NOT_PROCESSED
,
"Message not processed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NOT_READY
,
"Mnode not ready"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACTION_IN_PROGRESS
,
"Message is progressing"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACTION_NEED_REPROCESSED
,
"Message need to be reprocessed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NO_RIGHTS
,
"Insufficient privilege for operation"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_OPTIONS
,
"Invalid mnode options"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_CONNECTION
,
"Invalid message connection"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_MSG_VERSION
,
"Incompatible protocol version"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_MSG_LEN
,
"Invalid message length"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_MSG_TYPE
,
"Invalid message type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_SHELL_CONNS
,
"Too many connections"
)
// mnode-show
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_SHOWOBJ
,
"Data expired"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录