Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0cf4f039
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0cf4f039
编写于
3月 18, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
225602af
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
111 addition
and
104 deletion
+111
-104
include/common/tmsg.h
include/common/tmsg.h
+1
-0
include/dnode/bnode/bnode.h
include/dnode/bnode/bnode.h
+0
-2
include/util/taoserror.h
include/util/taoserror.h
+2
-15
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-0
source/dnode/bnode/src/bnode.c
source/dnode/bnode/src/bnode.c
+1
-1
source/dnode/mgmt/bnode/src/bmInt.c
source/dnode/mgmt/bnode/src/bmInt.c
+1
-1
source/dnode/mgmt/bnode/src/bmMsg.c
source/dnode/mgmt/bnode/src/bmMsg.c
+3
-3
source/dnode/mgmt/container/inc/dnd.h
source/dnode/mgmt/container/inc/dnd.h
+0
-1
source/dnode/mgmt/container/src/dndFile.c
source/dnode/mgmt/container/src/dndFile.c
+6
-6
source/dnode/mgmt/container/src/dndMsg.c
source/dnode/mgmt/container/src/dndMsg.c
+21
-1
source/dnode/mgmt/container/src/dndTransport.c
source/dnode/mgmt/container/src/dndTransport.c
+1
-1
source/dnode/mgmt/dnode/src/dmMsg.c
source/dnode/mgmt/dnode/src/dmMsg.c
+1
-1
source/dnode/mgmt/dnode/src/dmWorker.c
source/dnode/mgmt/dnode/src/dmWorker.c
+14
-2
source/dnode/mgmt/qnode/src/qmMgmt.c
source/dnode/mgmt/qnode/src/qmMgmt.c
+9
-9
source/dnode/mgmt/snode/src/smMgmt.c
source/dnode/mgmt/snode/src/smMgmt.c
+12
-12
source/dnode/mgmt/test/bnode/dbnode.cpp
source/dnode/mgmt/test/bnode/dbnode.cpp
+12
-9
source/dnode/mgmt/test/qnode/dqnode.cpp
source/dnode/mgmt/test/qnode/dqnode.cpp
+6
-6
source/dnode/mgmt/test/snode/dsnode.cpp
source/dnode/mgmt/test/snode/dsnode.cpp
+6
-6
source/dnode/mgmt/test/sut/src/server.cpp
source/dnode/mgmt/test/sut/src/server.cpp
+1
-1
source/dnode/mgmt/test/sut/src/sut.cpp
source/dnode/mgmt/test/sut/src/sut.cpp
+0
-1
source/dnode/mnode/impl/src/mndBnode.c
source/dnode/mnode/impl/src/mndBnode.c
+3
-3
source/dnode/mnode/impl/src/mndQnode.c
source/dnode/mnode/impl/src/mndQnode.c
+3
-3
source/dnode/mnode/impl/src/mndSnode.c
source/dnode/mnode/impl/src/mndSnode.c
+3
-3
source/dnode/mnode/impl/test/bnode/bnode.cpp
source/dnode/mnode/impl/test/bnode/bnode.cpp
+1
-2
source/util/src/terror.c
source/util/src/terror.c
+2
-15
未找到文件。
include/common/tmsg.h
浏览文件 @
0cf4f039
...
...
@@ -691,6 +691,7 @@ typedef struct {
int32_t
tSerializeSStatusRsp
(
void
*
buf
,
int32_t
bufLen
,
SStatusRsp
*
pRsp
);
int32_t
tDeserializeSStatusRsp
(
void
*
buf
,
int32_t
bufLen
,
SStatusRsp
*
pRsp
);
void
tFreeSStatusRsp
(
SStatusRsp
*
pRsp
);
typedef
struct
{
int32_t
reserved
;
...
...
include/dnode/bnode/bnode.h
浏览文件 @
0cf4f039
...
...
@@ -25,11 +25,9 @@ typedef struct SMgmtWrapper SMgmtWrapper;
typedef
struct
SBnode
SBnode
;
typedef
struct
{
int64_t
numOfErrors
;
}
SBnodeLoad
;
typedef
struct
{
int32_t
sver
;
int32_t
dnodeId
;
int64_t
clusterId
;
SMgmtWrapper
*
pWrapper
;
...
...
include/util/taoserror.h
浏览文件 @
0cf4f039
...
...
@@ -88,8 +88,8 @@ int32_t* taosGetErrno();
#define TSDB_CODE_COMPRESS_ERROR TAOS_DEF_ERROR_CODE(0, 0x0123)
#define TSDB_CODE_NODE_ALREADY_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0124)
#define TSDB_CODE_NODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0125)
#define TSDB_CODE_NODE_
READ_FILE_ERROR
TAOS_DEF_ERROR_CODE(0, 0x0126)
#define TSDB_CODE_NODE_
WRITE_FILE_ERROR
TAOS_DEF_ERROR_CODE(0, 0x0127)
#define TSDB_CODE_NODE_
PARSE_FILE_ERROR
TAOS_DEF_ERROR_CODE(0, 0x0126)
#define TSDB_CODE_NODE_
INVALID_OPTION
TAOS_DEF_ERROR_CODE(0, 0x0127)
//client
#define TSDB_CODE_TSC_INVALID_OPERATION TAOS_DEF_ERROR_CODE(0, 0x0200)
...
...
@@ -289,19 +289,6 @@ int32_t* taosGetErrno();
#define TSDB_CODE_DND_MNODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x0422)
#define TSDB_CODE_DND_MNODE_READ_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0423)
#define TSDB_CODE_DND_MNODE_WRITE_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0424)
#define TSDB_CODE_DND_QNODE_ALREADY_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0430)
#define TSDB_CODE_DND_QNODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0431)
#define TSDB_CODE_DND_QNODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x0432)
#define TSDB_CODE_DND_QNODE_READ_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0433)
#define TSDB_CODE_DND_QNODE_WRITE_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0434)
#define TSDB_CODE_DND_SNODE_ALREADY_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0440)
#define TSDB_CODE_DND_SNODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0441)
#define TSDB_CODE_DND_SNODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x0442)
#define TSDB_CODE_DND_SNODE_READ_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0443)
#define TSDB_CODE_DND_SNODE_WRITE_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0444)
#define TSDB_CODE_DND_BNODE_ALREADY_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0450)
#define TSDB_CODE_DND_BNODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0451)
#define TSDB_CODE_DND_BNODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x0452)
#define TSDB_CODE_DND_VNODE_ALREADY_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0460)
#define TSDB_CODE_DND_VNODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0461)
#define TSDB_CODE_DND_VNODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x0462)
...
...
source/common/src/tmsg.c
浏览文件 @
0cf4f039
...
...
@@ -757,6 +757,8 @@ int32_t tDeserializeSStatusRsp(void *buf, int32_t bufLen, SStatusRsp *pRsp) {
return
0
;
}
void
tFreeSStatusRsp
(
SStatusRsp
*
pRsp
)
{
taosArrayDestroy
(
pRsp
->
pDnodeEps
);
}
int32_t
tSerializeSCreateAcctReq
(
void
*
buf
,
int32_t
bufLen
,
SCreateAcctReq
*
pReq
)
{
SCoder
encoder
=
{
0
};
tCoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_ENCODER
);
...
...
source/dnode/bnode/src/bnode.c
浏览文件 @
0cf4f039
...
...
@@ -26,4 +26,4 @@ int32_t bndGetLoad(SBnode *pBnode, SBnodeLoad *pLoad) { return 0; }
int32_t
bndProcessWMsgs
(
SBnode
*
pBnode
,
SArray
*
pMsgs
)
{
return
0
;
}
void
bndDestroy
(
const
char
*
path
)
{}
void
bndDestroy
(
const
char
*
path
)
{
taosRemoveDir
(
path
);
}
source/dnode/mgmt/bnode/src/bmInt.c
浏览文件 @
0cf4f039
...
...
@@ -52,7 +52,7 @@ static int32_t bmOpenImp(SBnodeMgmt *pMgmt) {
}
static
void
bmCloseImp
(
SBnodeMgmt
*
pMgmt
)
{
if
(
pMgmt
->
pBnode
=
=
NULL
)
{
if
(
pMgmt
->
pBnode
!
=
NULL
)
{
bmStopWorker
(
pMgmt
);
bndClose
(
pMgmt
->
pBnode
);
pMgmt
->
pBnode
=
NULL
;
...
...
source/dnode/mgmt/bnode/src/bmMsg.c
浏览文件 @
0cf4f039
...
...
@@ -27,8 +27,8 @@ int32_t bmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
}
if
(
createReq
.
dnodeId
!=
pDnode
->
dnodeId
)
{
terrno
=
TSDB_CODE_
DND_B
NODE_INVALID_OPTION
;
dError
(
"failed to create bnode since %s
"
,
terrstr
()
);
terrno
=
TSDB_CODE_NODE_INVALID_OPTION
;
dError
(
"failed to create bnode since %s
, input:%d cur:%d"
,
terrstr
(),
createReq
.
dnodeId
,
pDnode
->
dnodeId
);
return
-
1
;
}
else
{
return
bmOpen
(
pWrapper
);
...
...
@@ -46,7 +46,7 @@ int32_t bmProcessDropReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
}
if
(
dropReq
.
dnodeId
!=
pDnode
->
dnodeId
)
{
terrno
=
TSDB_CODE_
DND_B
NODE_INVALID_OPTION
;
terrno
=
TSDB_CODE_NODE_INVALID_OPTION
;
dError
(
"failed to drop bnode since %s"
,
terrstr
());
return
-
1
;
}
else
{
...
...
source/dnode/mgmt/container/inc/dnd.h
浏览文件 @
0cf4f039
...
...
@@ -111,7 +111,6 @@ typedef struct SMgmtWrapper {
int32_t
refCount
;
SRWLatch
latch
;
bool
deployed
;
bool
dropped
;
bool
required
;
EProcType
procType
;
SProcObj
*
pProc
;
...
...
source/dnode/mgmt/container/src/dndFile.c
浏览文件 @
0cf4f039
...
...
@@ -17,7 +17,7 @@
#include "dndInt.h"
int32_t
dndReadFile
(
SMgmtWrapper
*
pWrapper
,
bool
*
pDeployed
)
{
int32_t
code
=
TSDB_CODE_NODE_
READ
_FILE_ERROR
;
int32_t
code
=
TSDB_CODE_NODE_
PARSE
_FILE_ERROR
;
int32_t
len
=
0
;
int32_t
maxLen
=
1024
;
char
*
content
=
calloc
(
1
,
maxLen
+
1
);
...
...
@@ -25,7 +25,7 @@ int32_t dndReadFile(SMgmtWrapper *pWrapper, bool *pDeployed) {
char
file
[
PATH_MAX
];
TdFilePtr
pFile
=
NULL
;
snprintf
(
file
,
sizeof
(
file
),
"%s%s%s.json"
,
pWrapper
->
path
,
pWrapper
->
name
,
TD_DIRSEP
);
snprintf
(
file
,
sizeof
(
file
),
"%s%s%s.json"
,
pWrapper
->
path
,
TD_DIRSEP
,
pWrapper
->
name
);
pFile
=
taosOpenFile
(
file
,
TD_FILE_READ
);
if
(
pFile
==
NULL
)
{
dDebug
(
"file %s not exist"
,
file
);
...
...
@@ -67,11 +67,11 @@ _OVER:
int32_t
dndWriteFile
(
SMgmtWrapper
*
pWrapper
,
bool
deployed
)
{
char
file
[
PATH_MAX
];
snprintf
(
file
,
sizeof
(
file
),
"%s%s%s.json"
,
pWrapper
->
path
,
pWrapper
->
name
,
TD_DIRSEP
);
snprintf
(
file
,
sizeof
(
file
),
"%s%s%s.json"
,
pWrapper
->
path
,
TD_DIRSEP
,
pWrapper
->
name
);
TdFilePtr
pFile
=
taosOpenFile
(
file
,
TD_FILE_CTEATE
|
TD_FILE_WRITE
|
TD_FILE_TRUNC
);
if
(
pFile
==
NULL
)
{
terrno
=
T
SDB_CODE_NODE_WRITE_FILE_ERROR
;
terrno
=
T
AOS_SYSTEM_ERROR
(
errno
)
;
dError
(
"failed to write %s since %s"
,
file
,
terrstr
());
return
-
1
;
}
...
...
@@ -90,10 +90,10 @@ int32_t dndWriteFile(SMgmtWrapper *pWrapper, bool deployed) {
free
(
content
);
char
realfile
[
PATH_MAX
];
snprintf
(
realfile
,
sizeof
(
realfile
),
"%s%s%s.json"
,
pWrapper
->
path
,
pWrapper
->
name
,
TD_DIRSEP
);
snprintf
(
realfile
,
sizeof
(
realfile
),
"%s%s%s.json"
,
pWrapper
->
path
,
TD_DIRSEP
,
pWrapper
->
name
);
if
(
taosRenameFile
(
file
,
realfile
)
!=
0
)
{
terrno
=
T
SDB_CODE_NODE_WRITE_FILE_ERROR
;
terrno
=
T
AOS_SYSTEM_ERROR
(
errno
)
;
dError
(
"failed to rename %s since %s"
,
file
,
terrstr
());
return
-
1
;
}
...
...
source/dnode/mgmt/container/src/dndMsg.c
浏览文件 @
0cf4f039
...
...
@@ -99,6 +99,13 @@ static int32_t dndProcessCreateNodeMsg(SDnode *pDnode, ENodeType ntype, SNodeMsg
}
pWrapper
=
&
pDnode
->
wrappers
[
ntype
];
if
(
taosMkDir
(
pWrapper
->
path
)
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
dError
(
"failed to create dir:%s since %s"
,
pWrapper
->
path
,
terrstr
());
return
-
1
;
}
int32_t
code
=
(
*
pWrapper
->
fp
.
createMsgFp
)(
pWrapper
,
pMsg
);
if
(
code
!=
0
)
{
dError
(
"node:%s, failed to open since %s"
,
pWrapper
->
name
,
terrstr
());
...
...
@@ -117,8 +124,21 @@ static int32_t dndProcessDropNodeMsg(SDnode *pDnode, ENodeType ntype, SNodeMsg *
return
-
1
;
}
dndCloseNode
(
pWrapper
);
taosWLockLatch
(
&
pWrapper
->
latch
);
pWrapper
->
deployed
=
false
;
int32_t
code
=
(
*
pWrapper
->
fp
.
dropMsgFp
)(
pWrapper
,
pMsg
);
if
(
code
!=
0
)
{
pWrapper
->
deployed
=
true
;
dError
(
"node:%s, failed to drop since %s"
,
pWrapper
->
name
,
terrstr
());
}
else
{
pWrapper
->
deployed
=
false
;
dDebug
(
"node:%s, has been dropped"
,
pWrapper
->
name
);
}
taosWUnLockLatch
(
&
pWrapper
->
latch
);
dndReleaseWrapper
(
pWrapper
);
return
code
;
}
int32_t
dndProcessNodeMsg
(
SDnode
*
pDnode
,
SNodeMsg
*
pMsg
)
{
...
...
source/dnode/mgmt/container/src/dndTransport.c
浏览文件 @
0cf4f039
...
...
@@ -38,7 +38,7 @@ static void dndProcessResponse(void *parent, SRpcMsg *pRsp, SEpSet *pEpSet) {
pRsp
->
ahandle
,
pRsp
->
code
&
0XFFFF
,
tstrerror
(
pRsp
->
code
));
dndProcessRpcMsg
(
pHandle
->
pWrapper
,
pRsp
,
pEpSet
);
}
else
{
dError
(
"rsp:%s not processed, app:%p"
,
TMSG_INFO
(
msgType
),
pRsp
->
ahandle
);
dError
(
"rsp:%s not processed
since no handle
, app:%p"
,
TMSG_INFO
(
msgType
),
pRsp
->
ahandle
);
rpcFreeCont
(
pRsp
->
pCont
);
}
}
...
...
source/dnode/mgmt/dnode/src/dmMsg.c
浏览文件 @
0cf4f039
...
...
@@ -87,7 +87,7 @@ int32_t dmProcessStatusRsp(SDnodeMgmt *pMgmt, SNodeMsg *pMsg) {
dmUpdateDnodeCfg
(
pMgmt
,
&
statusRsp
.
dnodeCfg
);
dmUpdateDnodeEps
(
pMgmt
,
statusRsp
.
pDnodeEps
);
}
t
aosArrayDestroy
(
statusRsp
.
pDnodeEps
);
t
FreeSStatusRsp
(
&
statusRsp
);
}
pMgmt
->
statusSent
=
0
;
...
...
source/dnode/mgmt/dnode/src/dmWorker.c
浏览文件 @
0cf4f039
...
...
@@ -56,7 +56,7 @@ static void dmProcessQueue(SDnodeMgmt *pMgmt, SNodeMsg *pMsg) {
int32_t
code
=
-
1
;
tmsg_t
msgType
=
pMsg
->
rpcMsg
.
msgType
;
SDnode
*
pDnode
=
pMgmt
->
pDnode
;
dTrace
(
"msg:%p, will be processed"
,
pMsg
);
dTrace
(
"msg:%p, will be processed
in dnode queue
"
,
pMsg
);
switch
(
msgType
)
{
case
TDMT_DND_CREATE_MNODE
:
...
...
@@ -69,10 +69,22 @@ static void dmProcessQueue(SDnodeMgmt *pMgmt, SNodeMsg *pMsg) {
case
TDMT_DND_DROP_BNODE
:
code
=
dndProcessNodeMsg
(
pMgmt
->
pDnode
,
pMsg
);
break
;
case
TDMT_DND_CONFIG_DNODE
:
code
=
dmProcessConfigReq
(
pMgmt
,
pMsg
);
break
;
case
TDMT_MND_STATUS_RSP
:
code
=
dmProcessStatusRsp
(
pMgmt
,
pMsg
);
break
;
case
TDMT_MND_AUTH_RSP
:
code
=
dmProcessAuthRsp
(
pMgmt
,
pMsg
);
break
;
case
TDMT_MND_GRANT_RSP
:
code
=
dmProcessGrantRsp
(
pMgmt
,
pMsg
);
break
;
default:
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
code
=
-
1
;
dError
(
"RPC %p, dnode msg:%s not processed"
,
pMsg
->
rpcMsg
.
handle
,
TMSG_INFO
(
msgType
));
dError
(
"RPC %p, dnode msg:%s not processed
in dnode queue
"
,
pMsg
->
rpcMsg
.
handle
,
TMSG_INFO
(
msgType
));
}
if
(
msgType
&
1u
)
{
...
...
source/dnode/mgmt/qnode/src/qmMgmt.c
浏览文件 @
0cf4f039
...
...
@@ -32,7 +32,7 @@ static SQnode *dndAcquireQnode(SDnode *pDnode) {
refCount = atomic_add_fetch_32(&pMgmt->refCount, 1);
pQnode = pMgmt->pQnode;
} else {
terrno = TSDB_CODE_
DND_Q
NODE_NOT_DEPLOYED;
terrno = TSDB_CODE_NODE_NOT_DEPLOYED;
}
taosRUnLockLatch(&pMgmt->latch);
...
...
@@ -54,7 +54,7 @@ static void dndReleaseQnode(SDnode *pDnode, SQnode *pQnode) {
static int32_t dndReadQnodeFile(SDnode *pDnode) {
SQnodeMgmt *pMgmt = &pDnode->qmgmt;
int32_t code = TSDB_CODE_
DND_QNODE_READ
_FILE_ERROR;
int32_t code = TSDB_CODE_
NODE_PARSE
_FILE_ERROR;
int32_t len = 0;
int32_t maxLen = 1024;
char *content = calloc(1, maxLen + 1);
...
...
@@ -119,7 +119,7 @@ static int32_t dndWriteQnodeFile(SDnode *pDnode) {
// FILE *fp = fopen(file, "w");
TdFilePtr pFile = taosOpenFile(file, TD_FILE_CTEATE | TD_FILE_WRITE | TD_FILE_TRUNC);
if (pFile == NULL) {
terrno = TSDB_CODE_
DND_Q
NODE_WRITE_FILE_ERROR;
terrno = TSDB_CODE_NODE_WRITE_FILE_ERROR;
dError("failed to write %s since %s", file, terrstr());
return -1;
}
...
...
@@ -142,7 +142,7 @@ static int32_t dndWriteQnodeFile(SDnode *pDnode) {
snprintf(realfile, PATH_MAX + 20, "%s/qnode.json", pDnode->dir.dnode);
if (taosRenameFile(file, realfile) != 0) {
terrno = TSDB_CODE_
DND_Q
NODE_WRITE_FILE_ERROR;
terrno = TSDB_CODE_NODE_WRITE_FILE_ERROR;
dError("failed to rename %s since %s", file, terrstr());
return -1;
}
...
...
@@ -197,7 +197,7 @@ static int32_t dndOpenQnode(SDnode *pDnode) {
SQnode *pQnode = dndAcquireQnode(pDnode);
if (pQnode != NULL) {
dndReleaseQnode(pDnode, pQnode);
terrno = TSDB_CODE_
DND_Q
NODE_ALREADY_DEPLOYED;
terrno = TSDB_CODE_NODE_ALREADY_DEPLOYED;
dError("failed to create qnode since %s", terrstr());
return -1;
}
...
...
@@ -275,7 +275,7 @@ int32_t qmProcessCreateReq(SDnode *pDnode, SRpcMsg *pReq) {
}
if (createReq.dnodeId != pDnode->dnodeId) {
terrno = TSDB_CODE_
DND_Q
NODE_INVALID_OPTION;
terrno = TSDB_CODE_NODE_INVALID_OPTION;
dError("failed to create qnode since %s", terrstr());
return -1;
} else {
...
...
@@ -291,7 +291,7 @@ int32_t qmProcessDropReq(SDnode *pDnode, SRpcMsg *pReq) {
}
if (dropReq.dnodeId != pDnode->dnodeId) {
terrno = TSDB_CODE_
DND_Q
NODE_INVALID_OPTION;
terrno = TSDB_CODE_NODE_INVALID_OPTION;
dError("failed to drop qnode since %s", terrstr());
return -1;
} else {
...
...
@@ -302,7 +302,7 @@ int32_t qmProcessDropReq(SDnode *pDnode, SRpcMsg *pReq) {
static void dndProcessQnodeQueue(SDnode *pDnode, SRpcMsg *pMsg) {
SQnodeMgmt *pMgmt = &pDnode->qmgmt;
SRpcMsg *pRsp = NULL;
int32_t code = TSDB_CODE_
DND_Q
NODE_NOT_DEPLOYED;
int32_t code = TSDB_CODE_NODE_NOT_DEPLOYED;
SQnode *pQnode = dndAcquireQnode(pDnode);
if (pQnode != NULL) {
...
...
@@ -327,7 +327,7 @@ static void dndProcessQnodeQueue(SDnode *pDnode, SRpcMsg *pMsg) {
}
static void dndWriteQnodeMsgToWorker(SDnode *pDnode, SDnodeWorker *pWorker, SRpcMsg *pMsg) {
int32_t code = TSDB_CODE_
DND_Q
NODE_NOT_DEPLOYED;
int32_t code = TSDB_CODE_NODE_NOT_DEPLOYED;
SQnode *pQnode = dndAcquireQnode(pDnode);
if (pQnode != NULL) {
...
...
source/dnode/mgmt/snode/src/smMgmt.c
浏览文件 @
0cf4f039
...
...
@@ -46,7 +46,7 @@ static SSnode *dndAcquireSnode(SDnode *pDnode) {
refCount = atomic_add_fetch_32(&pMgmt->refCount, 1);
pSnode = pMgmt->pSnode;
} else {
terrno = TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED;
terrno = TSDB_CODE_NODE_NOT_DEPLOYED;
}
taosRUnLockLatch(&pMgmt->latch);
...
...
@@ -68,7 +68,7 @@ static void dndReleaseSnode(SDnode *pDnode, SSnode *pSnode) {
static int32_t dndReadSnodeFile(SDnode *pDnode) {
SSnodeMgmt *pMgmt = &pDnode->smgmt;
int32_t code = TSDB_CODE_
DND_SNODE_READ
_FILE_ERROR;
int32_t code = TSDB_CODE_
NODE_PARSE
_FILE_ERROR;
int32_t len = 0;
int32_t maxLen = 1024;
char *content = calloc(1, maxLen + 1);
...
...
@@ -133,7 +133,7 @@ static int32_t dndWriteSnodeFile(SDnode *pDnode) {
// FILE *fp = fopen(file, "w");
TdFilePtr pFile = taosOpenFile(file, TD_FILE_CTEATE | TD_FILE_WRITE | TD_FILE_TRUNC);
if (pFile == NULL) {
terrno = TSDB_CODE_
DND_S
NODE_WRITE_FILE_ERROR;
terrno = TSDB_CODE_NODE_WRITE_FILE_ERROR;
dError("failed to write %s since %s", file, terrstr());
return -1;
}
...
...
@@ -156,7 +156,7 @@ static int32_t dndWriteSnodeFile(SDnode *pDnode) {
snprintf(realfile, PATH_MAX + 20, "%s/snode.json", pDnode->dir.dnode);
if (taosRenameFile(file, realfile) != 0) {
terrno = TSDB_CODE_
DND_S
NODE_WRITE_FILE_ERROR;
terrno = TSDB_CODE_NODE_WRITE_FILE_ERROR;
dError("failed to rename %s since %s", file, terrstr());
return -1;
}
...
...
@@ -221,7 +221,7 @@ static int32_t dndOpenSnode(SDnode *pDnode) {
SSnode *pSnode = dndAcquireSnode(pDnode);
if (pSnode != NULL) {
dndReleaseSnode(pDnode, pSnode);
terrno = TSDB_CODE_
DND_S
NODE_ALREADY_DEPLOYED;
terrno = TSDB_CODE_NODE_ALREADY_DEPLOYED;
dError("failed to create snode since %s", terrstr());
return -1;
}
...
...
@@ -300,7 +300,7 @@ int32_t smProcessCreateReq(SDnode *pDnode, SRpcMsg *pReq) {
}
if (createReq.dnodeId != pDnode->dnodeId) {
terrno = TSDB_CODE_
DND_S
NODE_INVALID_OPTION;
terrno = TSDB_CODE_NODE_INVALID_OPTION;
dError("failed to create snode since %s", terrstr());
return -1;
} else {
...
...
@@ -316,7 +316,7 @@ int32_t smProcessDropReq(SDnode *pDnode, SRpcMsg *pReq) {
}
if (dropReq.dnodeId != pDnode->dnodeId) {
terrno = TSDB_CODE_
DND_S
NODE_INVALID_OPTION;
terrno = TSDB_CODE_NODE_INVALID_OPTION;
dError("failed to drop snode since %s", terrstr());
return -1;
} else {
...
...
@@ -326,7 +326,7 @@ int32_t smProcessDropReq(SDnode *pDnode, SRpcMsg *pReq) {
static void dndProcessSnodeUniqueQueue(SDnode *pDnode, STaosQall *qall, int32_t numOfMsgs) {
/*SSnodeMgmt *pMgmt = &pDnode->smgmt;*/
int32_t code = TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED;
int32_t code = TSDB_CODE_NODE_NOT_DEPLOYED;
SSnode *pSnode = dndAcquireSnode(pDnode);
if (pSnode != NULL) {
...
...
@@ -355,7 +355,7 @@ static void dndProcessSnodeUniqueQueue(SDnode *pDnode, STaosQall *qall, int32_t
static void dndProcessSnodeSharedQueue(SDnode *pDnode, SRpcMsg *pMsg) {
/*SSnodeMgmt *pMgmt = &pDnode->smgmt;*/
int32_t code = TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED;
int32_t code = TSDB_CODE_NODE_NOT_DEPLOYED;
SSnode *pSnode = dndAcquireSnode(pDnode);
if (pSnode != NULL) {
...
...
@@ -391,7 +391,7 @@ static FORCE_INLINE int32_t dndGetSWIdFromMsg(SRpcMsg *pMsg) {
}
static void dndWriteSnodeMsgToWorkerByMsg(SDnode *pDnode, SRpcMsg *pMsg) {
int32_t code = TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED;
int32_t code = TSDB_CODE_NODE_NOT_DEPLOYED;
SSnode *pSnode = dndAcquireSnode(pDnode);
if (pSnode != NULL) {
...
...
@@ -412,7 +412,7 @@ static void dndWriteSnodeMsgToWorkerByMsg(SDnode *pDnode, SRpcMsg *pMsg) {
}
static void dndWriteSnodeMsgToMgmtWorker(SDnode *pDnode, SRpcMsg *pMsg) {
int32_t code = TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED;
int32_t code = TSDB_CODE_NODE_NOT_DEPLOYED;
SSnode *pSnode = dndAcquireSnode(pDnode);
if (pSnode != NULL) {
...
...
@@ -431,7 +431,7 @@ static void dndWriteSnodeMsgToMgmtWorker(SDnode *pDnode, SRpcMsg *pMsg) {
}
static void dndWriteSnodeMsgToWorker(SDnode *pDnode, SDnodeWorker *pWorker, SRpcMsg *pMsg) {
int32_t code = TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED;
int32_t code = TSDB_CODE_NODE_NOT_DEPLOYED;
SSnode *pSnode = dndAcquireSnode(pDnode);
if (pSnode != NULL) {
...
...
source/dnode/mgmt/test/bnode/dbnode.cpp
浏览文件 @
0cf4f039
...
...
@@ -13,7 +13,10 @@
class
DndTestBnode
:
public
::
testing
::
Test
{
protected:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/dnode_test_snode"
,
9112
);
}
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/dnode_test_bnode"
,
9112
);
taosMsleep
(
1100
);
}
static
void
TearDownTestSuite
()
{
test
.
Cleanup
();
}
static
Testbase
test
;
...
...
@@ -36,7 +39,7 @@ TEST_F(DndTestBnode, 01_Create_Bnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_B
NODE_INVALID_OPTION
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_INVALID_OPTION
);
}
{
...
...
@@ -62,7 +65,7 @@ TEST_F(DndTestBnode, 01_Create_Bnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_B
NODE_ALREADY_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_ALREADY_DEPLOYED
);
}
test
.
Restart
();
...
...
@@ -76,11 +79,11 @@ TEST_F(DndTestBnode, 01_Create_Bnode) {
tSerializeSMCreateDropQSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_B
NODE_ALREADY_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_ALREADY_DEPLOYED
);
}
}
TEST_F
(
DndTestBnode
,
0
1
_Drop_Bnode
)
{
TEST_F
(
DndTestBnode
,
0
2
_Drop_Bnode
)
{
{
SDDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
...
...
@@ -91,7 +94,7 @@ TEST_F(DndTestBnode, 01_Drop_Bnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_B
NODE_INVALID_OPTION
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_INVALID_OPTION
);
}
{
...
...
@@ -117,7 +120,7 @@ TEST_F(DndTestBnode, 01_Drop_Bnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_B
NODE_NOT_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_NOT_DEPLOYED
);
}
test
.
Restart
();
...
...
@@ -132,7 +135,7 @@ TEST_F(DndTestBnode, 01_Drop_Bnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_B
NODE_NOT_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_NOT_DEPLOYED
);
}
{
...
...
@@ -147,4 +150,4 @@ TEST_F(DndTestBnode, 01_Drop_Bnode) {
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
0
);
}
}
\ No newline at end of file
}
source/dnode/mgmt/test/qnode/dqnode.cpp
浏览文件 @
0cf4f039
...
...
@@ -36,7 +36,7 @@ TEST_F(DndTestQnode, 01_Create_Qnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_Q
NODE_INVALID_OPTION
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_INVALID_OPTION
);
}
{
...
...
@@ -62,7 +62,7 @@ TEST_F(DndTestQnode, 01_Create_Qnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_Q
NODE_ALREADY_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_ALREADY_DEPLOYED
);
}
test
.
Restart
();
...
...
@@ -77,7 +77,7 @@ TEST_F(DndTestQnode, 01_Create_Qnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_Q
NODE_ALREADY_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_ALREADY_DEPLOYED
);
}
}
...
...
@@ -92,7 +92,7 @@ TEST_F(DndTestQnode, 02_Drop_Qnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_Q
NODE_INVALID_OPTION
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_INVALID_OPTION
);
}
{
...
...
@@ -118,7 +118,7 @@ TEST_F(DndTestQnode, 02_Drop_Qnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_Q
NODE_NOT_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_NOT_DEPLOYED
);
}
test
.
Restart
();
...
...
@@ -133,7 +133,7 @@ TEST_F(DndTestQnode, 02_Drop_Qnode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_Q
NODE_NOT_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_NOT_DEPLOYED
);
}
{
...
...
source/dnode/mgmt/test/snode/dsnode.cpp
浏览文件 @
0cf4f039
...
...
@@ -36,7 +36,7 @@ TEST_F(DndTestSnode, 01_Create_Snode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_S
NODE_INVALID_OPTION
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_INVALID_OPTION
);
}
{
...
...
@@ -62,7 +62,7 @@ TEST_F(DndTestSnode, 01_Create_Snode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_S
NODE_ALREADY_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_ALREADY_DEPLOYED
);
}
test
.
Restart
();
...
...
@@ -77,7 +77,7 @@ TEST_F(DndTestSnode, 01_Create_Snode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_S
NODE_ALREADY_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_ALREADY_DEPLOYED
);
}
}
...
...
@@ -92,7 +92,7 @@ TEST_F(DndTestSnode, 01_Drop_Snode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_S
NODE_INVALID_OPTION
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_INVALID_OPTION
);
}
{
...
...
@@ -118,7 +118,7 @@ TEST_F(DndTestSnode, 01_Drop_Snode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_NOT_DEPLOYED
);
}
test
.
Restart
();
...
...
@@ -133,7 +133,7 @@ TEST_F(DndTestSnode, 01_Drop_Snode) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_NOT_DEPLOYED
);
}
{
...
...
source/dnode/mgmt/test/sut/src/server.cpp
浏览文件 @
0cf4f039
...
...
@@ -46,7 +46,7 @@ bool TestServer::DoStart() {
pthread_attr_setdetachstate
(
&
thAttr
,
PTHREAD_CREATE_JOINABLE
);
pthread_create
(
&
threadId
,
&
thAttr
,
serverLoop
,
pDnode
);
pthread_attr_destroy
(
&
thAttr
);
taosMsleep
(
10
00
);
taosMsleep
(
21
00
);
return
true
;
}
...
...
source/dnode/mgmt/test/sut/src/sut.cpp
浏览文件 @
0cf4f039
...
...
@@ -49,7 +49,6 @@ void Testbase::Init(const char* path, int16_t port) {
InitLog
(
"/tmp/td"
);
server
.
Start
(
path
,
fqdn
,
port
,
firstEp
);
client
.
Init
(
"root"
,
"taosdata"
,
fqdn
,
port
);
taosMsleep
(
1100
);
tFreeSTableMetaRsp
(
&
metaRsp
);
showId
=
0
;
...
...
source/dnode/mnode/impl/src/mndBnode.c
浏览文件 @
0cf4f039
...
...
@@ -203,7 +203,7 @@ static int32_t mndSetCreateBnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, S
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_DND_CREATE_BNODE
;
action
.
acceptableCode
=
TSDB_CODE_
DND_B
NODE_ALREADY_DEPLOYED
;
action
.
acceptableCode
=
TSDB_CODE_NODE_ALREADY_DEPLOYED
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pReq
);
...
...
@@ -230,7 +230,7 @@ static int32_t mndSetCreateBnodeUndoActions(STrans *pTrans, SDnodeObj *pDnode, S
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_DND_DROP_BNODE
;
action
.
acceptableCode
=
TSDB_CODE_
DND_B
NODE_NOT_DEPLOYED
;
action
.
acceptableCode
=
TSDB_CODE_NODE_NOT_DEPLOYED
;
if
(
mndTransAppendUndoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pReq
);
...
...
@@ -353,7 +353,7 @@ static int32_t mndSetDropBnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SBn
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_DND_DROP_BNODE
;
action
.
acceptableCode
=
TSDB_CODE_
DND_B
NODE_NOT_DEPLOYED
;
action
.
acceptableCode
=
TSDB_CODE_NODE_NOT_DEPLOYED
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pReq
);
...
...
source/dnode/mnode/impl/src/mndQnode.c
浏览文件 @
0cf4f039
...
...
@@ -205,7 +205,7 @@ static int32_t mndSetCreateQnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, S
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_DND_CREATE_QNODE
;
action
.
acceptableCode
=
TSDB_CODE_
DND_Q
NODE_ALREADY_DEPLOYED
;
action
.
acceptableCode
=
TSDB_CODE_NODE_ALREADY_DEPLOYED
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pReq
);
...
...
@@ -232,7 +232,7 @@ static int32_t mndSetCreateQnodeUndoActions(STrans *pTrans, SDnodeObj *pDnode, S
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_DND_DROP_QNODE
;
action
.
acceptableCode
=
TSDB_CODE_
DND_Q
NODE_NOT_DEPLOYED
;
action
.
acceptableCode
=
TSDB_CODE_NODE_NOT_DEPLOYED
;
if
(
mndTransAppendUndoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pReq
);
...
...
@@ -355,7 +355,7 @@ static int32_t mndSetDropQnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SQn
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_DND_DROP_QNODE
;
action
.
acceptableCode
=
TSDB_CODE_
DND_Q
NODE_NOT_DEPLOYED
;
action
.
acceptableCode
=
TSDB_CODE_NODE_NOT_DEPLOYED
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pReq
);
...
...
source/dnode/mnode/impl/src/mndSnode.c
浏览文件 @
0cf4f039
...
...
@@ -203,7 +203,7 @@ static int32_t mndSetCreateSnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, S
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_DND_CREATE_SNODE
;
action
.
acceptableCode
=
TSDB_CODE_
DND_S
NODE_ALREADY_DEPLOYED
;
action
.
acceptableCode
=
TSDB_CODE_NODE_ALREADY_DEPLOYED
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pReq
);
...
...
@@ -230,7 +230,7 @@ static int32_t mndSetCreateSnodeUndoActions(STrans *pTrans, SDnodeObj *pDnode, S
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_DND_DROP_SNODE
;
action
.
acceptableCode
=
TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED
;
action
.
acceptableCode
=
TSDB_CODE_NODE_NOT_DEPLOYED
;
if
(
mndTransAppendUndoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pReq
);
...
...
@@ -355,7 +355,7 @@ static int32_t mndSetDropSnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SSn
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_DND_DROP_SNODE
;
action
.
acceptableCode
=
TSDB_CODE_
DND_S
NODE_NOT_DEPLOYED
;
action
.
acceptableCode
=
TSDB_CODE_NODE_NOT_DEPLOYED
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pReq
);
...
...
source/dnode/mnode/impl/test/bnode/bnode.cpp
浏览文件 @
0cf4f039
...
...
@@ -49,7 +49,7 @@ TEST_F(MndTestBnode, 01_Show_Bnode) {
test
.
SendShowRetrieveReq
();
EXPECT_EQ
(
test
.
GetShowRows
(),
0
);
}
#if 0
TEST_F
(
MndTestBnode
,
02
_Create_Bnode
)
{
{
SMCreateBnodeReq
createReq
=
{
0
};
...
...
@@ -318,4 +318,3 @@ TEST_F(MndTestBnode, 04_Drop_Bnode_Rollback) {
ASSERT_NE
(
retry
,
retryMax
);
}
}
#endif
\ No newline at end of file
source/util/src/terror.c
浏览文件 @
0cf4f039
...
...
@@ -71,8 +71,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_RPC_INVALID_VERSION, "Invalid app version")
TAOS_DEFINE_ERROR
(
TSDB_CODE_COMPRESS_ERROR
,
"Failed to compress msg"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NODE_ALREADY_DEPLOYED
,
"Node already deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NODE_NOT_DEPLOYED
,
"Node not deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NODE_
READ_FILE_ERROR
,
"Read node.json error
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NODE_
WRITE_FILE_ERROR
,
"Write node.json error
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NODE_
PARSE_FILE_ERROR
,
"Invalid json format
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NODE_
INVALID_OPTION
,
"Invalid node option
"
)
//common & util
TAOS_DEFINE_ERROR
(
TSDB_CODE_OPS_NOT_SUPPORT
,
"Operation not supported"
)
...
...
@@ -285,19 +285,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_DND_MNODE_NOT_DEPLOYED, "Mnode not deployed")
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_MNODE_INVALID_OPTION
,
"Mnode option invalid"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_MNODE_READ_FILE_ERROR
,
"Read mnode.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_MNODE_WRITE_FILE_ERROR
,
"Write mnode.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_QNODE_ALREADY_DEPLOYED
,
"Qnode already deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_QNODE_NOT_DEPLOYED
,
"Qnode not deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_QNODE_INVALID_OPTION
,
"Qnode option invalid"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_QNODE_READ_FILE_ERROR
,
"Read qnode.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_QNODE_WRITE_FILE_ERROR
,
"Write qnode.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_SNODE_ALREADY_DEPLOYED
,
"Snode already deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_SNODE_NOT_DEPLOYED
,
"Snode not deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_SNODE_INVALID_OPTION
,
"Snode option invalid"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_SNODE_READ_FILE_ERROR
,
"Read snode.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_SNODE_WRITE_FILE_ERROR
,
"Write snode.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_BNODE_ALREADY_DEPLOYED
,
"Bnode already deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_BNODE_NOT_DEPLOYED
,
"Bnode not deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_BNODE_INVALID_OPTION
,
"Bnode option invalid"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_VNODE_ALREADY_DEPLOYED
,
"Vnode already deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_VNODE_NOT_DEPLOYED
,
"Vnode not deployed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_VNODE_INVALID_OPTION
,
"Vnode option invalid"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录