Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
44604633
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
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看板
提交
44604633
编写于
4月 09, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat<cluster>: create and delete qnode
上级
5972ee30
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
314 addition
and
330 deletion
+314
-330
include/common/tmsg.h
include/common/tmsg.h
+4
-11
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-10
source/dnode/mgmt/bm/bmHandle.c
source/dnode/mgmt/bm/bmHandle.c
+2
-2
source/dnode/mgmt/mm/mmHandle.c
source/dnode/mgmt/mm/mmHandle.c
+1
-1
source/dnode/mgmt/qm/qmHandle.c
source/dnode/mgmt/qm/qmHandle.c
+4
-5
source/dnode/mgmt/qm/qmWorker.c
source/dnode/mgmt/qm/qmWorker.c
+18
-14
source/dnode/mgmt/sm/smHandle.c
source/dnode/mgmt/sm/smHandle.c
+2
-2
source/dnode/mgmt/test/bnode/dbnode.cpp
source/dnode/mgmt/test/bnode/dbnode.cpp
+18
-18
source/dnode/mgmt/test/mnode/dmnode.cpp
source/dnode/mgmt/test/mnode/dmnode.cpp
+6
-6
source/dnode/mgmt/test/qnode/dqnode.cpp
source/dnode/mgmt/test/qnode/dqnode.cpp
+18
-18
source/dnode/mgmt/test/snode/dsnode.cpp
source/dnode/mgmt/test/snode/dsnode.cpp
+18
-18
source/dnode/mnode/impl/src/mndBnode.c
source/dnode/mnode/impl/src/mndBnode.c
+8
-8
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+1
-1
source/dnode/mnode/impl/src/mndMnode.c
source/dnode/mnode/impl/src/mndMnode.c
+4
-4
source/dnode/mnode/impl/src/mndQnode.c
source/dnode/mnode/impl/src/mndQnode.c
+76
-80
source/dnode/mnode/impl/src/mndSnode.c
source/dnode/mnode/impl/src/mndSnode.c
+8
-8
source/dnode/mnode/impl/test/bnode/bnode.cpp
source/dnode/mnode/impl/test/bnode/bnode.cpp
+28
-28
source/dnode/mnode/impl/test/mnode/mnode.cpp
source/dnode/mnode/impl/test/mnode/mnode.cpp
+26
-26
source/dnode/mnode/impl/test/qnode/qnode.cpp
source/dnode/mnode/impl/test/qnode/qnode.cpp
+28
-28
source/dnode/mnode/impl/test/snode/snode.cpp
source/dnode/mnode/impl/test/snode/snode.cpp
+28
-28
source/dnode/mnode/impl/test/trans/trans.cpp
source/dnode/mnode/impl/test/trans/trans.cpp
+10
-10
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+4
-4
未找到文件。
include/common/tmsg.h
浏览文件 @
44604633
...
...
@@ -1023,10 +1023,11 @@ int32_t tDeserializeSMCfgDnodeReq(void* buf, int32_t bufLen, SMCfgDnodeReq* pReq
typedef
struct
{
int32_t
dnodeId
;
}
SMCreateMnodeReq
,
SMDropMnodeReq
,
SDDropMnodeReq
;
}
SMCreateMnodeReq
,
SMDropMnodeReq
,
SDDropMnodeReq
,
SMCreateQnodeReq
,
SMDropQnodeReq
,
SDCreateQnodeReq
,
SDDropQnodeReq
,
SMCreateSnodeReq
,
SMDropSnodeReq
,
SDCreateSnodeReq
,
SDDropSnodeReq
,
SMCreateBnodeReq
,
SMDropBnodeReq
,
SDCreateBnodeReq
,
SDDropBnodeReq
;
int32_t
tSerializeS
MCreateDropMnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateM
nodeReq
*
pReq
);
int32_t
tDeserializeS
MCreateDropMnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateM
nodeReq
*
pReq
);
int32_t
tSerializeS
CreateDropMQSBNodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateQ
nodeReq
*
pReq
);
int32_t
tDeserializeS
CreateDropMQSBNodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateQ
nodeReq
*
pReq
);
typedef
struct
{
int32_t
dnodeId
;
...
...
@@ -1037,14 +1038,6 @@ typedef struct {
int32_t
tSerializeSDCreateMnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SDCreateMnodeReq
*
pReq
);
int32_t
tDeserializeSDCreateMnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SDCreateMnodeReq
*
pReq
);
typedef
struct
{
int32_t
dnodeId
;
}
SMCreateQnodeReq
,
SMDropQnodeReq
,
SDCreateQnodeReq
,
SDDropQnodeReq
,
SMCreateSnodeReq
,
SMDropSnodeReq
,
SDCreateSnodeReq
,
SDDropSnodeReq
,
SMCreateBnodeReq
,
SMDropBnodeReq
,
SDCreateBnodeReq
,
SDDropBnodeReq
;
int32_t
tSerializeSMCreateDropQSBNodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateQnodeReq
*
pReq
);
int32_t
tDeserializeSMCreateDropQSBNodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateQnodeReq
*
pReq
);
typedef
struct
{
char
sql
[
TSDB_SHOW_SQL_LEN
];
int32_t
queryId
;
...
...
source/common/src/tmsg.c
浏览文件 @
44604633
...
...
@@ -1203,7 +1203,7 @@ int32_t tDeserializeSGetUserAuthRsp(void *buf, int32_t bufLen, SGetUserAuthRsp *
return
0
;
}
int32_t
tSerializeS
MCreateDrop
QSBNodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateQnodeReq
*
pReq
)
{
int32_t
tSerializeS
CreateDropM
QSBNodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateQnodeReq
*
pReq
)
{
SCoder
encoder
=
{
0
};
tCoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_ENCODER
);
...
...
@@ -1216,7 +1216,7 @@ int32_t tSerializeSMCreateDropQSBNodeReq(void *buf, int32_t bufLen, SMCreateQnod
return
tlen
;
}
int32_t
tDeserializeS
MCreateDrop
QSBNodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateQnodeReq
*
pReq
)
{
int32_t
tDeserializeS
CreateDropM
QSBNodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateQnodeReq
*
pReq
)
{
SCoder
decoder
=
{
0
};
tCoderInit
(
&
decoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_DECODER
);
...
...
@@ -1257,14 +1257,6 @@ int32_t tDeserializeSDropDnodeReq(void *buf, int32_t bufLen, SDropDnodeReq *pReq
return
0
;
}
int32_t
tSerializeSMCreateDropMnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateMnodeReq
*
pReq
)
{
return
tSerializeSMCreateDropQSBNodeReq
(
buf
,
bufLen
,
(
SMCreateQnodeReq
*
)
pReq
);
}
int32_t
tDeserializeSMCreateDropMnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCreateMnodeReq
*
pReq
)
{
return
tDeserializeSMCreateDropQSBNodeReq
(
buf
,
bufLen
,
(
SMCreateQnodeReq
*
)
pReq
);
}
int32_t
tSerializeSMCfgDnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SMCfgDnodeReq
*
pReq
)
{
SCoder
encoder
=
{
0
};
tCoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_ENCODER
);
...
...
source/dnode/mgmt/bm/bmHandle.c
浏览文件 @
44604633
...
...
@@ -49,7 +49,7 @@ int32_t bmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDCreateBnodeReq
createReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
...
...
@@ -68,7 +68,7 @@ int32_t bmProcessDropReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDDropBnodeReq
dropReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
...
...
source/dnode/mgmt/mm/mmHandle.c
浏览文件 @
44604633
...
...
@@ -70,7 +70,7 @@ int32_t mmProcessDropReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDDropMnodeReq
dropReq
=
{
0
};
if
(
tDeserializeS
MCreateDropMn
odeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropMQSBN
odeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
...
...
source/dnode/mgmt/qm/qmHandle.c
浏览文件 @
44604633
...
...
@@ -16,8 +16,7 @@
#define _DEFAULT_SOURCE
#include "qmInt.h"
void
qmGetMonitorInfo
(
SMgmtWrapper
*
pWrapper
,
SMonQmInfo
*
qmInfo
)
{
}
void
qmGetMonitorInfo
(
SMgmtWrapper
*
pWrapper
,
SMonQmInfo
*
qmInfo
)
{}
int32_t
qmProcessGetMonQmInfoReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
)
{
SMonQmInfo
qmInfo
=
{
0
};
...
...
@@ -49,14 +48,14 @@ int32_t qmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDCreateQnodeReq
createReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
if
(
createReq
.
dnodeId
!=
pDnode
->
dnodeId
)
{
terrno
=
TSDB_CODE_NODE_INVALID_OPTION
;
dError
(
"failed to create qnode since %s
, input:%d cur:%d"
,
terrstr
(),
createReq
.
dnodeId
,
pDnode
->
dnodeId
);
dError
(
"failed to create qnode since %s
"
,
terrstr
()
);
return
-
1
;
}
else
{
return
qmOpen
(
pWrapper
);
...
...
@@ -68,7 +67,7 @@ int32_t qmProcessDropReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDDropQnodeReq
dropReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
...
...
source/dnode/mgmt/qm/qmWorker.c
浏览文件 @
44604633
...
...
@@ -25,15 +25,17 @@ static inline void qmSendRsp(SMgmtWrapper *pWrapper, SNodeMsg *pMsg, int32_t cod
tmsgSendRsp
(
&
rsp
);
}
static
void
qmProcessMonQueue
(
SQueueInfo
*
pInfo
,
SNodeMsg
*
pMsg
)
{
static
void
qmProcessMon
itor
Queue
(
SQueueInfo
*
pInfo
,
SNodeMsg
*
pMsg
)
{
SQnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
dTrace
(
"msg:%p, get from qnode
monitor queue"
,
pMsg
);
dTrace
(
"msg:%p, get from qnode
-
monitor queue"
,
pMsg
);
SRpcMsg
*
pRpc
=
&
pMsg
->
rpcMsg
;
int32_t
code
=
-
1
;
if
(
pMsg
->
rpcMsg
.
msgType
==
TDMT_MON_SM_INFO
)
{
code
=
qmProcessGetMonQmInfoReq
(
pMgmt
->
pWrapper
,
pMsg
);
}
else
{
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
}
if
(
pRpc
->
msgType
&
1U
)
{
...
...
@@ -49,9 +51,11 @@ static void qmProcessMonQueue(SQueueInfo *pInfo, SNodeMsg *pMsg) {
static
void
qmProcessQueryQueue
(
SQueueInfo
*
pInfo
,
SNodeMsg
*
pMsg
)
{
SQnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
dTrace
(
"msg:%p, will be processed in qnode-query queue"
,
pMsg
);
int32_t
code
=
qndProcessQueryMsg
(
pMgmt
->
pQnode
,
&
pMsg
->
rpcMsg
);
if
(
code
!=
0
)
{
dTrace
(
"msg:%p, get from qnode-query queue"
,
pMsg
);
SRpcMsg
*
pRpc
=
&
pMsg
->
rpcMsg
;
int32_t
code
=
qndProcessQueryMsg
(
pMgmt
->
pQnode
,
pRpc
);
if
(
pRpc
->
msgType
&
1U
&&
code
!=
0
)
{
qmSendRsp
(
pMgmt
->
pWrapper
,
pMsg
,
code
);
}
...
...
@@ -63,9 +67,11 @@ static void qmProcessQueryQueue(SQueueInfo *pInfo, SNodeMsg *pMsg) {
static
void
qmProcessFetchQueue
(
SQueueInfo
*
pInfo
,
SNodeMsg
*
pMsg
)
{
SQnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
dTrace
(
"msg:%p, will be processed in qnode-fetch queue"
,
pMsg
);
int32_t
code
=
qndProcessFetchMsg
(
pMgmt
->
pQnode
,
&
pMsg
->
rpcMsg
);
if
(
code
!=
0
)
{
dTrace
(
"msg:%p, get from qnode-fetch queue"
,
pMsg
);
SRpcMsg
*
pRpc
=
&
pMsg
->
rpcMsg
;
int32_t
code
=
qndProcessFetchMsg
(
pMgmt
->
pQnode
,
pRpc
);
if
(
pRpc
->
msgType
&
1U
&&
code
!=
0
)
{
qmSendRsp
(
pMgmt
->
pWrapper
,
pMsg
,
code
);
}
...
...
@@ -92,11 +98,8 @@ int32_t qmProcessFetchMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
}
int32_t
qmProcessMonitorMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SQnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
SSingleWorker
*
pWorker
=
&
pMgmt
->
monitorWorker
;
dTrace
(
"msg:%p, put into worker:%s"
,
pMsg
,
pWorker
->
name
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
SQnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
qmPutMsgToWorker
(
&
pMgmt
->
monitorWorker
,
pMsg
);
return
0
;
}
...
...
@@ -125,6 +128,7 @@ int32_t qmPutMsgToFetchQueue(SMgmtWrapper *pWrapper, SRpcMsg *pRpc) {
int32_t
qmGetQueueSize
(
SMgmtWrapper
*
pWrapper
,
int32_t
vgId
,
EQueueType
qtype
)
{
int32_t
size
=
-
1
;
SQnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
switch
(
qtype
)
{
case
QUERY_QUEUE
:
size
=
taosQueueSize
(
pMgmt
->
queryWorker
.
queue
);
...
...
@@ -164,7 +168,7 @@ int32_t qmStartWorker(SQnodeMgmt *pMgmt) {
if
(
tsMultiProcess
)
{
SSingleWorkerCfg
mCfg
=
{
.
min
=
1
,
.
max
=
1
,
.
name
=
"qnode-monitor"
,
.
fp
=
(
FItem
)
qmProcessMonQueue
,
.
param
=
pMgmt
};
.
min
=
1
,
.
max
=
1
,
.
name
=
"qnode-monitor"
,
.
fp
=
(
FItem
)
qmProcessMon
itor
Queue
,
.
param
=
pMgmt
};
if
(
tSingleWorkerInit
(
&
pMgmt
->
monitorWorker
,
&
mCfg
)
!=
0
)
{
dError
(
"failed to start qnode-monitor worker since %s"
,
terrstr
());
return
-
1
;
...
...
source/dnode/mgmt/sm/smHandle.c
浏览文件 @
44604633
...
...
@@ -48,7 +48,7 @@ int32_t smProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDCreateSnodeReq
createReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
...
...
@@ -67,7 +67,7 @@ int32_t smProcessDropReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDDropSnodeReq
dropReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
...
...
source/dnode/mgmt/test/bnode/dbnode.cpp
浏览文件 @
44604633
...
...
@@ -33,9 +33,9 @@ TEST_F(DndTestBnode, 01_Create_Bnode) {
SDCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -46,9 +46,9 @@ TEST_F(DndTestBnode, 01_Create_Bnode) {
SDCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -59,9 +59,9 @@ TEST_F(DndTestBnode, 01_Create_Bnode) {
SDCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -74,9 +74,9 @@ TEST_F(DndTestBnode, 01_Create_Bnode) {
SDCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_NODE_ALREADY_DEPLOYED
);
...
...
@@ -88,9 +88,9 @@ TEST_F(DndTestBnode, 02_Drop_Bnode) {
SDDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -101,9 +101,9 @@ TEST_F(DndTestBnode, 02_Drop_Bnode) {
SDDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -114,9 +114,9 @@ TEST_F(DndTestBnode, 02_Drop_Bnode) {
SDDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -129,9 +129,9 @@ TEST_F(DndTestBnode, 02_Drop_Bnode) {
SDDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -142,9 +142,9 @@ TEST_F(DndTestBnode, 02_Drop_Bnode) {
SDCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
source/dnode/mgmt/test/mnode/dmnode.cpp
浏览文件 @
44604633
...
...
@@ -139,9 +139,9 @@ TEST_F(DndTestMnode, 03_Drop_Mnode) {
SDDropMnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -152,9 +152,9 @@ TEST_F(DndTestMnode, 03_Drop_Mnode) {
SDDropMnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -165,9 +165,9 @@ TEST_F(DndTestMnode, 03_Drop_Mnode) {
SDDropMnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
source/dnode/mgmt/test/qnode/dqnode.cpp
浏览文件 @
44604633
...
...
@@ -30,9 +30,9 @@ TEST_F(DndTestQnode, 01_Create_Qnode) {
SDCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -43,9 +43,9 @@ TEST_F(DndTestQnode, 01_Create_Qnode) {
SDCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -56,9 +56,9 @@ TEST_F(DndTestQnode, 01_Create_Qnode) {
SDCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -71,9 +71,9 @@ TEST_F(DndTestQnode, 01_Create_Qnode) {
SDCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -86,9 +86,9 @@ TEST_F(DndTestQnode, 02_Drop_Qnode) {
SDDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -99,9 +99,9 @@ TEST_F(DndTestQnode, 02_Drop_Qnode) {
SDDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -112,9 +112,9 @@ TEST_F(DndTestQnode, 02_Drop_Qnode) {
SDDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -127,9 +127,9 @@ TEST_F(DndTestQnode, 02_Drop_Qnode) {
SDDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -140,9 +140,9 @@ TEST_F(DndTestQnode, 02_Drop_Qnode) {
SDCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
source/dnode/mgmt/test/snode/dsnode.cpp
浏览文件 @
44604633
...
...
@@ -30,9 +30,9 @@ TEST_F(DndTestSnode, 01_Create_Snode) {
SDCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -43,9 +43,9 @@ TEST_F(DndTestSnode, 01_Create_Snode) {
SDCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -56,9 +56,9 @@ TEST_F(DndTestSnode, 01_Create_Snode) {
SDCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -71,9 +71,9 @@ TEST_F(DndTestSnode, 01_Create_Snode) {
SDCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -86,9 +86,9 @@ TEST_F(DndTestSnode, 01_Drop_Snode) {
SDDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -99,9 +99,9 @@ TEST_F(DndTestSnode, 01_Drop_Snode) {
SDDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -112,9 +112,9 @@ TEST_F(DndTestSnode, 01_Drop_Snode) {
SDDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -127,9 +127,9 @@ TEST_F(DndTestSnode, 01_Drop_Snode) {
SDDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -140,9 +140,9 @@ TEST_F(DndTestSnode, 01_Drop_Snode) {
SDCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
source/dnode/mnode/impl/src/mndBnode.c
浏览文件 @
44604633
...
...
@@ -190,13 +190,13 @@ static int32_t mndSetCreateBnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, S
SDCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
pDnode
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
if
(
pReq
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
...
...
@@ -217,13 +217,13 @@ static int32_t mndSetCreateBnodeUndoActions(STrans *pTrans, SDnodeObj *pDnode, S
SDDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
pDnode
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
if
(
pReq
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
...
...
@@ -274,7 +274,7 @@ static int32_t mndProcessCreateBnodeReq(SNodeMsg *pReq) {
SUserObj
*
pUser
=
NULL
;
SMCreateBnodeReq
createReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
CREATE_BNODE_OVER
;
}
...
...
@@ -340,13 +340,13 @@ static int32_t mndSetDropBnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SBn
SDDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
pDnode
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
if
(
pReq
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
...
...
@@ -389,7 +389,7 @@ static int32_t mndProcessDropBnodeReq(SNodeMsg *pReq) {
SBnodeObj
*
pObj
=
NULL
;
SMDropBnodeReq
dropReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
DROP_BNODE_OVER
;
}
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
44604633
...
...
@@ -554,7 +554,7 @@ static int32_t mndProcessDropDnodeReq(SNodeMsg *pReq) {
SDnodeObj
*
pDnode
=
NULL
;
SMDropMnodeReq
dropReq
=
{
0
};
if
(
tDeserializeS
MCreateDropMn
odeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropMQSBN
odeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
DROP_DNODE_OVER
;
}
...
...
source/dnode/mnode/impl/src/mndMnode.c
浏览文件 @
44604633
...
...
@@ -388,7 +388,7 @@ static int32_t mndProcessCreateMnodeReq(SNodeMsg *pReq) {
SUserObj
*
pUser
=
NULL
;
SMCreateMnodeReq
createReq
=
{
0
};
if
(
tDeserializeS
MCreateDropMn
odeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropMQSBN
odeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
CREATE_MNODE_OVER
;
}
...
...
@@ -509,9 +509,9 @@ static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnode
SDDropMnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
pObj
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
dropReq
);
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
action
.
pCont
=
pReq
;
...
...
@@ -554,7 +554,7 @@ static int32_t mndProcessDropMnodeReq(SNodeMsg *pReq) {
SMnodeObj
*
pObj
=
NULL
;
SMDropMnodeReq
dropReq
=
{
0
};
if
(
tDeserializeS
MCreateDropMn
odeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropMQSBN
odeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
DROP_MNODE_OVER
;
}
...
...
source/dnode/mnode/impl/src/mndQnode.c
浏览文件 @
44604633
...
...
@@ -21,22 +21,22 @@
#include "mndTrans.h"
#include "mndUser.h"
#define
TSDB_QNODE_VER_NUMBER
1
#define
TSDB_
QNODE_RESERVE_SIZE 64
#define
QNODE_VER_NUMBER
1
#define QNODE_RESERVE_SIZE 64
static
SSdbRaw
*
mndQnodeActionEncode
(
SQnodeObj
*
pObj
);
static
SSdbRow
*
mndQnodeActionDecode
(
SSdbRaw
*
pRaw
);
static
int32_t
mndQnodeActionInsert
(
SSdb
*
pSdb
,
SQnodeObj
*
pObj
);
static
int32_t
mndQnodeActionDelete
(
SSdb
*
pSdb
,
SQnodeObj
*
pObj
);
static
int32_t
mndQnodeActionUpdate
(
SSdb
*
pSdb
,
SQnodeObj
*
pOld
,
SQnodeObj
*
pNew
);
static
int32_t
mndQnodeActionDelete
(
SSdb
*
pSdb
,
SQnodeObj
*
pObj
);
static
int32_t
mndProcessCreateQnodeReq
(
SNodeMsg
*
pReq
);
static
int32_t
mndProcessDropQnodeReq
(
SNodeMsg
*
pReq
);
static
int32_t
mndProcessCreateQnodeRsp
(
SNodeMsg
*
pRsp
);
static
int32_t
mndProcessDropQnodeReq
(
SNodeMsg
*
pReq
);
static
int32_t
mndProcessDropQnodeRsp
(
SNodeMsg
*
pRsp
);
static
int32_t
mndProcessQnodeListReq
(
SNodeMsg
*
pReq
);
static
int32_t
mndGetQnodeMeta
(
SNodeMsg
*
pReq
,
SShowObj
*
pShow
,
STableMetaRsp
*
pMeta
);
static
int32_t
mndRetrieveQnodes
(
SNodeMsg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextQnode
(
SMnode
*
pMnode
,
void
*
pIter
);
static
int32_t
mndProcessQnodeListReq
(
SNodeMsg
*
pReq
);
int32_t
mndInitQnode
(
SMnode
*
pMnode
)
{
SSdbTable
table
=
{.
sdbType
=
SDB_QNODE
,
...
...
@@ -49,9 +49,9 @@ int32_t mndInitQnode(SMnode *pMnode) {
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CREATE_QNODE
,
mndProcessCreateQnodeReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_DROP_QNODE
,
mndProcessDropQnodeReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_QNODE_LIST
,
mndProcessQnodeListReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_DND_CREATE_QNODE_RSP
,
mndProcessCreateQnodeRsp
);
mndSetMsgHandle
(
pMnode
,
TDMT_DND_DROP_QNODE_RSP
,
mndProcessDropQnodeRsp
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_QNODE_LIST
,
mndProcessQnodeListReq
);
mndAddShowMetaHandle
(
pMnode
,
TSDB_MGMT_TABLE_QNODE
,
mndGetQnodeMeta
);
mndAddShowRetrieveHandle
(
pMnode
,
TSDB_MGMT_TABLE_QNODE
,
mndRetrieveQnodes
);
...
...
@@ -78,18 +78,18 @@ static void mndReleaseQnode(SMnode *pMnode, SQnodeObj *pObj) {
static
SSdbRaw
*
mndQnodeActionEncode
(
SQnodeObj
*
pObj
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
SSdbRaw
*
pRaw
=
sdbAllocRaw
(
SDB_QNODE
,
TSDB_QNODE_VER_NUMBER
,
sizeof
(
SQnodeObj
)
+
TSDB_
QNODE_RESERVE_SIZE
);
if
(
pRaw
==
NULL
)
goto
QNODE_ENCODE
_OVER
;
SSdbRaw
*
pRaw
=
sdbAllocRaw
(
SDB_QNODE
,
QNODE_VER_NUMBER
,
sizeof
(
SQnodeObj
)
+
QNODE_RESERVE_SIZE
);
if
(
pRaw
==
NULL
)
goto
_OVER
;
int32_t
dataPos
=
0
;
SDB_SET_INT32
(
pRaw
,
dataPos
,
pObj
->
id
,
QNODE_ENCODE
_OVER
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pObj
->
createdTime
,
QNODE_ENCODE
_OVER
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pObj
->
updateTime
,
QNODE_ENCODE
_OVER
)
SDB_SET_RESERVE
(
pRaw
,
dataPos
,
TSDB_QNODE_RESERVE_SIZE
,
QNODE_ENCODE
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pObj
->
id
,
_OVER
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pObj
->
createdTime
,
_OVER
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pObj
->
updateTime
,
_OVER
)
SDB_SET_RESERVE
(
pRaw
,
dataPos
,
QNODE_RESERVE_SIZE
,
_OVER
)
terrno
=
0
;
QNODE_ENCODE
_OVER:
_OVER:
if
(
terrno
!=
0
)
{
mError
(
"qnode:%d, failed to encode to raw:%p since %s"
,
pObj
->
id
,
pRaw
,
terrstr
());
sdbFreeRaw
(
pRaw
);
...
...
@@ -104,28 +104,28 @@ static SSdbRow *mndQnodeActionDecode(SSdbRaw *pRaw) {
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
int8_t
sver
=
0
;
if
(
sdbGetRawSoftVer
(
pRaw
,
&
sver
)
!=
0
)
goto
QNODE_DECODE
_OVER
;
if
(
sdbGetRawSoftVer
(
pRaw
,
&
sver
)
!=
0
)
goto
_OVER
;
if
(
sver
!=
TSDB_
QNODE_VER_NUMBER
)
{
if
(
sver
!=
QNODE_VER_NUMBER
)
{
terrno
=
TSDB_CODE_SDB_INVALID_DATA_VER
;
goto
QNODE_DECODE
_OVER
;
goto
_OVER
;
}
SSdbRow
*
pRow
=
sdbAllocRow
(
sizeof
(
SQnodeObj
));
if
(
pRow
==
NULL
)
goto
QNODE_DECODE
_OVER
;
if
(
pRow
==
NULL
)
goto
_OVER
;
SQnodeObj
*
pObj
=
sdbGetRowObj
(
pRow
);
if
(
pObj
==
NULL
)
goto
QNODE_DECODE
_OVER
;
if
(
pObj
==
NULL
)
goto
_OVER
;
int32_t
dataPos
=
0
;
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pObj
->
id
,
QNODE_DECODE
_OVER
)
SDB_GET_INT64
(
pRaw
,
dataPos
,
&
pObj
->
createdTime
,
QNODE_DECODE
_OVER
)
SDB_GET_INT64
(
pRaw
,
dataPos
,
&
pObj
->
updateTime
,
QNODE_DECODE
_OVER
)
SDB_GET_RESERVE
(
pRaw
,
dataPos
,
TSDB_QNODE_RESERVE_SIZE
,
QNODE_DECODE
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pObj
->
id
,
_OVER
)
SDB_GET_INT64
(
pRaw
,
dataPos
,
&
pObj
->
createdTime
,
_OVER
)
SDB_GET_INT64
(
pRaw
,
dataPos
,
&
pObj
->
updateTime
,
_OVER
)
SDB_GET_RESERVE
(
pRaw
,
dataPos
,
QNODE_RESERVE_SIZE
,
_OVER
)
terrno
=
0
;
QNODE_DECODE
_OVER:
_OVER:
if
(
terrno
!=
0
)
{
mError
(
"qnode:%d, failed to decode from raw:%p since %s"
,
pObj
->
id
,
pRaw
,
terrstr
());
taosMemoryFreeClear
(
pRow
);
...
...
@@ -192,13 +192,13 @@ static int32_t mndSetCreateQnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, S
SDCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
pDnode
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
if
(
pReq
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
...
...
@@ -219,13 +219,13 @@ static int32_t mndSetCreateQnodeUndoActions(STrans *pTrans, SDnodeObj *pDnode, S
SDDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
pDnode
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
if
(
pReq
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
...
...
@@ -251,19 +251,19 @@ static int32_t mndCreateQnode(SMnode *pMnode, SNodeMsg *pReq, SDnodeObj *pDnode,
qnodeObj
.
updateTime
=
qnodeObj
.
createdTime
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_TYPE_CREATE_QNODE
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
goto
CREATE_QNODE
_OVER
;
if
(
pTrans
==
NULL
)
goto
_OVER
;
mDebug
(
"trans:%d, used to create qnode:%d"
,
pTrans
->
id
,
pCreate
->
dnodeId
);
if
(
mndSetCreateQnodeRedoLogs
(
pTrans
,
&
qnodeObj
)
!=
0
)
goto
CREATE_QNODE
_OVER
;
if
(
mndSetCreateQnodeUndoLogs
(
pTrans
,
&
qnodeObj
)
!=
0
)
goto
CREATE_QNODE
_OVER
;
if
(
mndSetCreateQnodeCommitLogs
(
pTrans
,
&
qnodeObj
)
!=
0
)
goto
CREATE_QNODE
_OVER
;
if
(
mndSetCreateQnodeRedoActions
(
pTrans
,
pDnode
,
&
qnodeObj
)
!=
0
)
goto
CREATE_QNODE
_OVER
;
if
(
mndSetCreateQnodeUndoActions
(
pTrans
,
pDnode
,
&
qnodeObj
)
!=
0
)
goto
CREATE_QNODE
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
CREATE_QNODE
_OVER
;
if
(
mndSetCreateQnodeRedoLogs
(
pTrans
,
&
qnodeObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateQnodeUndoLogs
(
pTrans
,
&
qnodeObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateQnodeCommitLogs
(
pTrans
,
&
qnodeObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateQnodeRedoActions
(
pTrans
,
pDnode
,
&
qnodeObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateQnodeUndoActions
(
pTrans
,
pDnode
,
&
qnodeObj
)
!=
0
)
goto
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
code
=
0
;
CREATE_QNODE
_OVER:
_OVER:
mndTransDrop
(
pTrans
);
return
code
;
}
...
...
@@ -276,9 +276,9 @@ static int32_t mndProcessCreateQnodeReq(SNodeMsg *pReq) {
SUserObj
*
pUser
=
NULL
;
SMCreateQnodeReq
createReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
CREATE_QNODE
_OVER
;
goto
_OVER
;
}
mDebug
(
"qnode:%d, start to create"
,
createReq
.
dnodeId
);
...
...
@@ -286,31 +286,31 @@ static int32_t mndProcessCreateQnodeReq(SNodeMsg *pReq) {
pObj
=
mndAcquireQnode
(
pMnode
,
createReq
.
dnodeId
);
if
(
pObj
!=
NULL
)
{
terrno
=
TSDB_CODE_MND_QNODE_ALREADY_EXIST
;
goto
CREATE_QNODE
_OVER
;
goto
_OVER
;
}
else
if
(
terrno
!=
TSDB_CODE_MND_QNODE_NOT_EXIST
)
{
goto
CREATE_QNODE
_OVER
;
goto
_OVER
;
}
pDnode
=
mndAcquireDnode
(
pMnode
,
createReq
.
dnodeId
);
if
(
pDnode
==
NULL
)
{
terrno
=
TSDB_CODE_MND_DNODE_NOT_EXIST
;
goto
CREATE_QNODE
_OVER
;
goto
_OVER
;
}
pUser
=
mndAcquireUser
(
pMnode
,
pReq
->
user
);
if
(
pUser
==
NULL
)
{
terrno
=
TSDB_CODE_MND_NO_USER_FROM_CONN
;
goto
CREATE_QNODE
_OVER
;
goto
_OVER
;
}
if
(
mndCheckNodeAuth
(
pUser
))
{
goto
CREATE_QNODE
_OVER
;
goto
_OVER
;
}
code
=
mndCreateQnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
CREATE_QNODE
_OVER:
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
{
mError
(
"qnode:%d, failed to create since %s"
,
createReq
.
dnodeId
,
terrstr
());
}
...
...
@@ -318,7 +318,6 @@ CREATE_QNODE_OVER:
mndReleaseQnode
(
pMnode
,
pObj
);
mndReleaseDnode
(
pMnode
,
pDnode
);
mndReleaseUser
(
pMnode
,
pUser
);
return
code
;
}
...
...
@@ -342,13 +341,13 @@ static int32_t mndSetDropQnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SQn
SDDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
pDnode
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
if
(
pReq
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
...
...
@@ -369,17 +368,17 @@ static int32_t mndDropQnode(SMnode *pMnode, SNodeMsg *pReq, SQnodeObj *pObj) {
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_TYPE_DROP_QNODE
,
&
pReq
->
rpcMsg
);
if
(
pTrans
==
NULL
)
goto
DROP_QNODE
_OVER
;
if
(
pTrans
==
NULL
)
goto
_OVER
;
mDebug
(
"trans:%d, used to drop qnode:%d"
,
pTrans
->
id
,
pObj
->
id
);
if
(
mndSetDropQnodeRedoLogs
(
pTrans
,
pObj
)
!=
0
)
goto
DROP_QNODE
_OVER
;
if
(
mndSetDropQnodeCommitLogs
(
pTrans
,
pObj
)
!=
0
)
goto
DROP_QNODE
_OVER
;
if
(
mndSetDropQnodeRedoActions
(
pTrans
,
pObj
->
pDnode
,
pObj
)
!=
0
)
goto
DROP_QNODE
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
DROP_QNODE
_OVER
;
if
(
mndSetDropQnodeRedoLogs
(
pTrans
,
pObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropQnodeCommitLogs
(
pTrans
,
pObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetDropQnodeRedoActions
(
pTrans
,
pObj
->
pDnode
,
pObj
)
!=
0
)
goto
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
code
=
0
;
DROP_QNODE
_OVER:
_OVER:
mndTransDrop
(
pTrans
);
return
code
;
}
...
...
@@ -391,37 +390,37 @@ static int32_t mndProcessDropQnodeReq(SNodeMsg *pReq) {
SQnodeObj
*
pObj
=
NULL
;
SMDropQnodeReq
dropReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
DROP_QNODE
_OVER
;
goto
_OVER
;
}
mDebug
(
"qnode:%d, start to drop"
,
dropReq
.
dnodeId
);
if
(
dropReq
.
dnodeId
<=
0
)
{
terrno
=
TSDB_CODE_SDB_APP_ERROR
;
goto
DROP_QNODE
_OVER
;
goto
_OVER
;
}
pObj
=
mndAcquireQnode
(
pMnode
,
dropReq
.
dnodeId
);
if
(
pObj
==
NULL
)
{
goto
DROP_QNODE
_OVER
;
goto
_OVER
;
}
pUser
=
mndAcquireUser
(
pMnode
,
pReq
->
user
);
if
(
pUser
==
NULL
)
{
terrno
=
TSDB_CODE_MND_NO_USER_FROM_CONN
;
goto
DROP_QNODE
_OVER
;
goto
_OVER
;
}
if
(
mndCheckNodeAuth
(
pUser
))
{
goto
DROP_QNODE
_OVER
;
goto
_OVER
;
}
code
=
mndDropQnode
(
pMnode
,
pReq
,
pObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
DROP_QNODE
_OVER:
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
{
mError
(
"qnode:%d, failed to drop since %s"
,
dropReq
.
dnodeId
,
terrstr
());
}
...
...
@@ -433,37 +432,36 @@ DROP_QNODE_OVER:
}
static
int32_t
mndProcessQnodeListReq
(
SNodeMsg
*
pReq
)
{
int32_t
code
=
-
1
;
SQnodeListReq
qlistReq
=
{
0
}
;
int32_t
numOfRows
=
0
;
S
Mnode
*
pMnode
=
pReq
->
pNode
;
S
Sdb
*
pSdb
=
pMnode
->
pSdb
;
SQnode
Obj
*
pObj
=
NULL
;
int32_t
code
=
-
1
;
int32_t
numOfRows
=
0
;
SMnode
*
pMnode
=
pReq
->
pNode
;
S
Sdb
*
pSdb
=
pMnode
->
pSdb
;
S
QnodeObj
*
pObj
=
NULL
;
SQnode
ListReq
qlistReq
=
{
0
}
;
SQnodeListRsp
qlistRsp
=
{
0
};
if
(
tDeserializeSQnodeListReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
qlistReq
)
!=
0
)
{
mError
(
"
invalid qnode list msg
"
);
mError
(
"
failed to parse qnode list req
"
);
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
QNODE_LIST
_OVER
;
goto
_OVER
;
}
qlistRsp
.
epSetList
=
taosArrayInit
(
5
,
sizeof
(
SEpSet
));
if
(
NULL
==
qlistRsp
.
epSetList
)
{
mError
(
"
taosArrayInit epSet failed
"
);
mError
(
"
failed to alloc epSet while process qnode list req
"
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
QNODE_LIST
_OVER
;
goto
_OVER
;
}
while
(
true
)
{
void
*
pIter
=
sdbFetch
(
pSdb
,
SDB_QNODE
,
NULL
,
(
void
**
)
&
pObj
);
if
(
pIter
==
NULL
)
break
;
SEpSet
epSet
=
{
0
};
strcpy
(
epSet
.
eps
[
0
].
fqdn
,
pObj
->
pDnode
->
fqdn
);
SEpSet
epSet
=
{
.
numOfEps
=
1
};
tstrncpy
(
epSet
.
eps
[
0
].
fqdn
,
pObj
->
pDnode
->
fqdn
,
TSDB_FQDN_LEN
);
epSet
.
eps
[
0
].
port
=
pObj
->
pDnode
->
port
;
epSet
.
numOfEps
=
1
;
taosArrayPush
(
qlistRsp
.
epSetList
,
&
epSet
);
(
void
)
taosArrayPush
(
qlistRsp
.
epSetList
,
&
epSet
);
numOfRows
++
;
sdbRelease
(
pSdb
,
pObj
);
...
...
@@ -477,19 +475,17 @@ static int32_t mndProcessQnodeListReq(SNodeMsg *pReq) {
void
*
pRsp
=
taosMemoryMalloc
(
rspLen
);
if
(
pRsp
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
QNODE_LIST
_OVER
;
goto
_OVER
;
}
tSerializeSQnodeListRsp
(
pRsp
,
rspLen
,
&
qlistRsp
);
pReq
->
rspLen
=
rspLen
;
pReq
->
pRsp
=
pRsp
;
code
=
0
;
QNODE_LIST_OVER:
_OVER:
tFreeSQnodeListRsp
(
&
qlistRsp
);
return
code
;
}
...
...
source/dnode/mnode/impl/src/mndSnode.c
浏览文件 @
44604633
...
...
@@ -199,13 +199,13 @@ static int32_t mndSetCreateSnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, S
SDCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
pDnode
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
if
(
pReq
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
...
...
@@ -226,13 +226,13 @@ static int32_t mndSetCreateSnodeUndoActions(STrans *pTrans, SDnodeObj *pDnode, S
SDDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
pDnode
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
if
(
pReq
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
...
...
@@ -284,7 +284,7 @@ static int32_t mndProcessCreateSnodeReq(SNodeMsg *pReq) {
SUserObj
*
pUser
=
NULL
;
SMCreateSnodeReq
createReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
createReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
createReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
CREATE_SNODE_OVER
;
}
...
...
@@ -351,13 +351,13 @@ static int32_t mndSetDropSnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SSn
SDDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
pDnode
->
id
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
taosMemoryMalloc
(
contLen
);
if
(
pReq
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
STransAction
action
=
{
0
};
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
...
...
@@ -401,7 +401,7 @@ static int32_t mndProcessDropSnodeReq(SNodeMsg *pReq) {
SSnodeObj
*
pObj
=
NULL
;
SMDropSnodeReq
dropReq
=
{
0
};
if
(
tDeserializeS
MCreateDrop
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
if
(
tDeserializeS
CreateDropM
QSBNodeReq
(
pReq
->
rpcMsg
.
pCont
,
pReq
->
rpcMsg
.
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
DROP_SNODE_OVER
;
}
...
...
source/dnode/mnode/impl/test/bnode/bnode.cpp
浏览文件 @
44604633
...
...
@@ -55,9 +55,9 @@ TEST_F(MndTestBnode, 02_Create_Bnode) {
SMCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -68,9 +68,9 @@ TEST_F(MndTestBnode, 02_Create_Bnode) {
SMCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -90,9 +90,9 @@ TEST_F(MndTestBnode, 02_Create_Bnode) {
SMCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -124,9 +124,9 @@ TEST_F(MndTestBnode, 03_Drop_Bnode) {
SMCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -148,9 +148,9 @@ TEST_F(MndTestBnode, 03_Drop_Bnode) {
SMDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -169,9 +169,9 @@ TEST_F(MndTestBnode, 03_Drop_Bnode) {
SMDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -185,9 +185,9 @@ TEST_F(MndTestBnode, 03_Create_Bnode_Rollback) {
SMCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
server2
.
Stop
();
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
...
...
@@ -200,9 +200,9 @@ TEST_F(MndTestBnode, 03_Create_Bnode_Rollback) {
SMCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -214,9 +214,9 @@ TEST_F(MndTestBnode, 03_Create_Bnode_Rollback) {
SMDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -235,9 +235,9 @@ TEST_F(MndTestBnode, 03_Create_Bnode_Rollback) {
SMCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -255,9 +255,9 @@ TEST_F(MndTestBnode, 04_Drop_Bnode_Rollback) {
SMDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
server2
.
Stop
();
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_BNODE
,
pReq
,
contLen
);
...
...
@@ -270,9 +270,9 @@ TEST_F(MndTestBnode, 04_Drop_Bnode_Rollback) {
SMCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -284,9 +284,9 @@ TEST_F(MndTestBnode, 04_Drop_Bnode_Rollback) {
SMDropBnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -305,9 +305,9 @@ TEST_F(MndTestBnode, 04_Drop_Bnode_Rollback) {
SMCreateBnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
source/dnode/mnode/impl/test/mnode/mnode.cpp
浏览文件 @
44604633
...
...
@@ -63,9 +63,9 @@ TEST_F(MndTestMnode, 02_Create_Mnode_Invalid_Id) {
SMCreateMnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -78,9 +78,9 @@ TEST_F(MndTestMnode, 03_Create_Mnode_Invalid_Id) {
SMCreateMnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -114,9 +114,9 @@ TEST_F(MndTestMnode, 04_Create_Mnode) {
SMCreateMnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -143,9 +143,9 @@ TEST_F(MndTestMnode, 04_Create_Mnode) {
SMDropMnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -167,9 +167,9 @@ TEST_F(MndTestMnode, 04_Create_Mnode) {
SMDropMnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -183,9 +183,9 @@ TEST_F(MndTestMnode, 03_Create_Mnode_Rollback) {
SMCreateMnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
createReq
);
server2
.
Stop
();
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_MNODE
,
pReq
,
contLen
);
...
...
@@ -198,9 +198,9 @@ TEST_F(MndTestMnode, 03_Create_Mnode_Rollback) {
SMCreateMnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -212,9 +212,9 @@ TEST_F(MndTestMnode, 03_Create_Mnode_Rollback) {
SMDropMnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -233,9 +233,9 @@ TEST_F(MndTestMnode, 03_Create_Mnode_Rollback) {
SMCreateMnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -253,9 +253,9 @@ TEST_F(MndTestMnode, 04_Drop_Mnode_Rollback) {
SMDropMnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
dropReq
);
server2
.
Stop
();
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_MNODE
,
pReq
,
contLen
);
...
...
@@ -268,9 +268,9 @@ TEST_F(MndTestMnode, 04_Drop_Mnode_Rollback) {
SMCreateMnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -282,9 +282,9 @@ TEST_F(MndTestMnode, 04_Drop_Mnode_Rollback) {
SMDropMnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -303,9 +303,9 @@ TEST_F(MndTestMnode, 04_Drop_Mnode_Rollback) {
SMCreateMnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDropMn
odeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropMQSBN
odeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDropMn
odeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropMQSBN
odeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_MNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
source/dnode/mnode/impl/test/qnode/qnode.cpp
浏览文件 @
44604633
...
...
@@ -55,9 +55,9 @@ TEST_F(MndTestQnode, 02_Create_Qnode) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -68,9 +68,9 @@ TEST_F(MndTestQnode, 02_Create_Qnode) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -90,9 +90,9 @@ TEST_F(MndTestQnode, 02_Create_Qnode) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -124,9 +124,9 @@ TEST_F(MndTestQnode, 03_Drop_Qnode) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -148,9 +148,9 @@ TEST_F(MndTestQnode, 03_Drop_Qnode) {
SMDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -169,9 +169,9 @@ TEST_F(MndTestQnode, 03_Drop_Qnode) {
SMDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -185,9 +185,9 @@ TEST_F(MndTestQnode, 03_Create_Qnode_Rollback) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
server2
.
Stop
();
taosMsleep
(
1000
);
...
...
@@ -203,9 +203,9 @@ TEST_F(MndTestQnode, 03_Create_Qnode_Rollback) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -217,9 +217,9 @@ TEST_F(MndTestQnode, 03_Create_Qnode_Rollback) {
SMDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -239,9 +239,9 @@ TEST_F(MndTestQnode, 03_Create_Qnode_Rollback) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -258,9 +258,9 @@ TEST_F(MndTestQnode, 04_Drop_Qnode_Rollback) {
SMDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
server2
.
Stop
();
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_QNODE
,
pReq
,
contLen
);
...
...
@@ -273,9 +273,9 @@ TEST_F(MndTestQnode, 04_Drop_Qnode_Rollback) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_SDB_OBJ_DROPPING
);
...
...
@@ -286,9 +286,9 @@ TEST_F(MndTestQnode, 04_Drop_Qnode_Rollback) {
SMDropQnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -307,9 +307,9 @@ TEST_F(MndTestQnode, 04_Drop_Qnode_Rollback) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
if
(
pRsp
->
code
==
0
)
break
;
...
...
source/dnode/mnode/impl/test/snode/snode.cpp
浏览文件 @
44604633
...
...
@@ -55,9 +55,9 @@ TEST_F(MndTestSnode, 02_Create_Snode) {
SMCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -68,9 +68,9 @@ TEST_F(MndTestSnode, 02_Create_Snode) {
SMCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -90,9 +90,9 @@ TEST_F(MndTestSnode, 02_Create_Snode) {
SMCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -124,9 +124,9 @@ TEST_F(MndTestSnode, 03_Drop_Snode) {
SMCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -148,9 +148,9 @@ TEST_F(MndTestSnode, 03_Drop_Snode) {
SMDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -169,9 +169,9 @@ TEST_F(MndTestSnode, 03_Drop_Snode) {
SMDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -185,9 +185,9 @@ TEST_F(MndTestSnode, 03_Create_Snode_Rollback) {
SMCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
server2
.
Stop
();
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_SNODE
,
pReq
,
contLen
);
...
...
@@ -200,9 +200,9 @@ TEST_F(MndTestSnode, 03_Create_Snode_Rollback) {
SMCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -214,9 +214,9 @@ TEST_F(MndTestSnode, 03_Create_Snode_Rollback) {
SMDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -235,9 +235,9 @@ TEST_F(MndTestSnode, 03_Create_Snode_Rollback) {
SMCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -255,9 +255,9 @@ TEST_F(MndTestSnode, 04_Drop_Snode_Rollback) {
SMDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
server2
.
Stop
();
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_SNODE
,
pReq
,
contLen
);
...
...
@@ -270,9 +270,9 @@ TEST_F(MndTestSnode, 04_Drop_Snode_Rollback) {
SMCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -284,9 +284,9 @@ TEST_F(MndTestSnode, 04_Drop_Snode_Rollback) {
SMDropSnodeReq
dropReq
=
{
0
};
dropReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
dropReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -305,9 +305,9 @@ TEST_F(MndTestSnode, 04_Drop_Snode_Rollback) {
SMCreateSnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
source/dnode/mnode/impl/test/trans/trans.cpp
浏览文件 @
44604633
...
...
@@ -136,9 +136,9 @@ TEST_F(MndTestTrans, 02_Create_Qnode1_Crash) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -155,9 +155,9 @@ TEST_F(MndTestTrans, 02_Create_Qnode1_Crash) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
1
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -194,9 +194,9 @@ TEST_F(MndTestTrans, 03_Create_Qnode2_Crash) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
server2
.
Stop
();
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
...
...
@@ -249,9 +249,9 @@ TEST_F(MndTestTrans, 03_Create_Qnode2_Crash) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -274,9 +274,9 @@ TEST_F(MndTestTrans, 03_Create_Qnode2_Crash) {
SMCreateQnodeReq
createReq
=
{
0
};
createReq
.
dnodeId
=
2
;
int32_t
contLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
int32_t
contLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeS
MCreateDrop
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pReq
,
contLen
,
&
createReq
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
44604633
...
...
@@ -2043,12 +2043,12 @@ static int32_t translateCreateQnode(STranslateContext* pCxt, SCreateQnodeStmt* p
}
pCxt
->
pCmdMsg
->
epSet
=
pCxt
->
pParseCxt
->
mgmtEpSet
;
pCxt
->
pCmdMsg
->
msgType
=
TDMT_DND_CREATE_QNODE
;
pCxt
->
pCmdMsg
->
msgLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
pCxt
->
pCmdMsg
->
msgLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
createReq
);
pCxt
->
pCmdMsg
->
pMsg
=
taosMemoryMalloc
(
pCxt
->
pCmdMsg
->
msgLen
);
if
(
NULL
==
pCxt
->
pCmdMsg
->
pMsg
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pCxt
->
pCmdMsg
->
pMsg
,
pCxt
->
pCmdMsg
->
msgLen
,
&
createReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pCxt
->
pCmdMsg
->
pMsg
,
pCxt
->
pCmdMsg
->
msgLen
,
&
createReq
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -2062,12 +2062,12 @@ static int32_t translateDropQnode(STranslateContext* pCxt, SDropQnodeStmt* pStmt
}
pCxt
->
pCmdMsg
->
epSet
=
pCxt
->
pParseCxt
->
mgmtEpSet
;
pCxt
->
pCmdMsg
->
msgType
=
TDMT_DND_DROP_QNODE
;
pCxt
->
pCmdMsg
->
msgLen
=
tSerializeS
MCreateDrop
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
pCxt
->
pCmdMsg
->
msgLen
=
tSerializeS
CreateDropM
QSBNodeReq
(
NULL
,
0
,
&
dropReq
);
pCxt
->
pCmdMsg
->
pMsg
=
taosMemoryMalloc
(
pCxt
->
pCmdMsg
->
msgLen
);
if
(
NULL
==
pCxt
->
pCmdMsg
->
pMsg
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
tSerializeS
MCreateDrop
QSBNodeReq
(
pCxt
->
pCmdMsg
->
pMsg
,
pCxt
->
pCmdMsg
->
msgLen
,
&
dropReq
);
tSerializeS
CreateDropM
QSBNodeReq
(
pCxt
->
pCmdMsg
->
pMsg
,
pCxt
->
pCmdMsg
->
msgLen
,
&
dropReq
);
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录