Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
33a60b60
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
33a60b60
编写于
1月 07, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
c2eadc27
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
78 addition
and
69 deletion
+78
-69
include/common/tmsg.h
include/common/tmsg.h
+4
-4
include/util/taoserror.h
include/util/taoserror.h
+6
-3
source/dnode/mgmt/impl/inc/dndVnodes.h
source/dnode/mgmt/impl/inc/dndVnodes.h
+6
-6
source/dnode/mgmt/impl/src/dndVnodes.c
source/dnode/mgmt/impl/src/dndVnodes.c
+37
-34
source/dnode/mgmt/impl/test/vnode/vnode.cpp
source/dnode/mgmt/impl/test/vnode/vnode.cpp
+7
-7
source/dnode/mnode/impl/inc/mndVgroup.h
source/dnode/mnode/impl/inc/mndVgroup.h
+2
-2
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+8
-8
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+4
-4
source/util/src/terror.c
source/util/src/terror.c
+4
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
33a60b60
...
...
@@ -805,19 +805,19 @@ typedef struct {
int8_t
replica
;
int8_t
selfIndex
;
SReplica
replicas
[
TSDB_MAX_REPLICA
];
}
SCreateVnode
Msg
,
SAlterVnodeMsg
;
}
SCreateVnode
Req
,
SAlterVnodeReq
;
typedef
struct
{
int32_t
vgId
;
int32_t
dnodeId
;
char
db
[
TSDB_DB_FNAME_LEN
];
uint64_t
dbUid
;
}
SDropVnodeMsg
,
SSyncVnodeMsg
,
SCompactVnodeMsg
;
char
db
[
TSDB_DB_FNAME_LEN
];
}
SDropVnodeReq
,
SSyncVnodeReq
,
SCompactVnodeReq
;
typedef
struct
{
int32_t
vgId
;
int8_t
accessState
;
}
SAuthVnode
Msg
;
}
SAuthVnode
Req
;
typedef
struct
{
SMsgHead
header
;
...
...
include/util/taoserror.h
浏览文件 @
33a60b60
...
...
@@ -277,9 +277,12 @@ int32_t* taosGetErrno();
#define TSDB_CODE_DND_BNODE_INVALID_OPTION TAOS_DEF_ERROR_CODE(0, 0x0452)
#define TSDB_CODE_DND_BNODE_READ_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0453)
#define TSDB_CODE_DND_BNODE_WRITE_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0454)
#define TSDB_CODE_DND_VNODE_TOO_MANY_VNODES TAOS_DEF_ERROR_CODE(0, 0x0460)
#define TSDB_CODE_DND_VNODE_READ_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0461)
#define TSDB_CODE_DND_VNODE_WRITE_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0462)
#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)
#define TSDB_CODE_DND_VNODE_READ_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0463)
#define TSDB_CODE_DND_VNODE_WRITE_FILE_ERROR TAOS_DEF_ERROR_CODE(0, 0x0464)
#define TSDB_CODE_DND_VNODE_TOO_MANY_VNODES TAOS_DEF_ERROR_CODE(0, 0x0465)
// vnode
#define TSDB_CODE_VND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0500) //"Action in progress")
...
...
source/dnode/mgmt/impl/inc/dndVnodes.h
浏览文件 @
33a60b60
...
...
@@ -29,12 +29,12 @@ void dndProcessVnodeSyncMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet);
void
dndProcessVnodeQueryMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
void
dndProcessVnodeFetchMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
int32_t
dndProcessCreateVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
);
int32_t
dndProcessAlterVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
);
int32_t
dndProcessDropVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
);
int32_t
dndProcessAuthVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
);
int32_t
dndProcessSyncVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
);
int32_t
dndProcessCompactVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
);
int32_t
dndProcessCreateVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
int32_t
dndProcessAlterVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
int32_t
dndProcessDropVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
int32_t
dndProcessAuthVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
int32_t
dndProcessSyncVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
int32_t
dndProcessCompactVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/impl/src/dndVnodes.c
浏览文件 @
33a60b60
...
...
@@ -527,8 +527,8 @@ static void dndCloseVnodes(SDnode *pDnode) {
dInfo
(
"total vnodes:%d are all closed"
,
numOfVnodes
);
}
static
SCreateVnode
Msg
*
dndParseCreateVnodeReq
(
SRpcMsg
*
rpcMsg
)
{
SCreateVnode
Msg
*
pCreate
=
rpcMsg
->
pCont
;
static
SCreateVnode
Req
*
dndParseCreateVnodeReq
(
SRpcMsg
*
rpcMsg
)
{
SCreateVnode
Req
*
pCreate
=
rpcMsg
->
pCont
;
pCreate
->
vgId
=
htonl
(
pCreate
->
vgId
);
pCreate
->
dnodeId
=
htonl
(
pCreate
->
dnodeId
);
pCreate
->
dbUid
=
htobe64
(
pCreate
->
dbUid
);
...
...
@@ -552,7 +552,7 @@ static SCreateVnodeMsg *dndParseCreateVnodeReq(SRpcMsg *rpcMsg) {
return
pCreate
;
}
static
void
dndGenerateVnodeCfg
(
SCreateVnode
Msg
*
pCreate
,
SVnodeCfg
*
pCfg
)
{
static
void
dndGenerateVnodeCfg
(
SCreateVnode
Req
*
pCreate
,
SVnodeCfg
*
pCfg
)
{
pCfg
->
vgId
=
pCreate
->
vgId
;
pCfg
->
wsize
=
pCreate
->
cacheBlockSize
;
pCfg
->
ssize
=
pCreate
->
cacheBlockSize
;
...
...
@@ -576,7 +576,7 @@ static void dndGenerateVnodeCfg(SCreateVnodeMsg *pCreate, SVnodeCfg *pCfg) {
pCfg
->
walCfg
.
vgId
=
pCreate
->
vgId
;
}
static
void
dndGenerateWrapperCfg
(
SDnode
*
pDnode
,
SCreateVnode
Msg
*
pCreate
,
SWrapperCfg
*
pCfg
)
{
static
void
dndGenerateWrapperCfg
(
SDnode
*
pDnode
,
SCreateVnode
Req
*
pCreate
,
SWrapperCfg
*
pCfg
)
{
memcpy
(
pCfg
->
db
,
pCreate
->
db
,
TSDB_DB_FNAME_LEN
);
pCfg
->
dbUid
=
pCreate
->
dbUid
;
pCfg
->
dropped
=
0
;
...
...
@@ -585,20 +585,20 @@ static void dndGenerateWrapperCfg(SDnode *pDnode, SCreateVnodeMsg *pCreate, SWra
pCfg
->
vgVersion
=
pCreate
->
vgVersion
;
}
static
SDropVnode
Msg
*
vnodeParseDropVnodeReq
(
SRpcMsg
*
rpcMsg
)
{
SDropVnode
Msg
*
pDrop
=
rpcMsg
->
pCont
;
static
SDropVnode
Req
*
vnodeParseDropVnodeReq
(
SRpcMsg
*
rpcMsg
)
{
SDropVnode
Req
*
pDrop
=
rpcMsg
->
pCont
;
pDrop
->
vgId
=
htonl
(
pDrop
->
vgId
);
return
pDrop
;
}
static
SAuthVnode
Msg
*
vnodeParseAuthVnodeReq
(
SRpcMsg
*
rpcMsg
)
{
SAuthVnode
Msg
*
pAuth
=
rpcMsg
->
pCont
;
static
SAuthVnode
Req
*
vnodeParseAuthVnodeReq
(
SRpcMsg
*
rpcMsg
)
{
SAuthVnode
Req
*
pAuth
=
rpcMsg
->
pCont
;
pAuth
->
vgId
=
htonl
(
pAuth
->
vgId
);
return
pAuth
;
}
int32_t
dndProcessCreateVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
)
{
SCreateVnode
Msg
*
pCreate
=
dndParseCreateVnodeReq
(
rpcMsg
);
int32_t
dndProcessCreateVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
SCreateVnode
Req
*
pCreate
=
dndParseCreateVnodeReq
(
pReq
);
dDebug
(
"vgId:%d, create vnode req is received"
,
pCreate
->
vgId
);
SVnodeCfg
vnodeCfg
=
{
0
};
...
...
@@ -611,16 +611,19 @@ int32_t dndProcessCreateVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
if
(
pVnode
!=
NULL
)
{
dDebug
(
"vgId:%d, already exist, return success"
,
pCreate
->
vgId
);
dndReleaseVnode
(
pDnode
,
pVnode
);
return
0
;
terrno
=
TSDB_CODE_DND_VNODE_ALREADY_DEPLOYED
;
return
-
1
;
}
SVnode
*
pImpl
=
vnodeOpen
(
wrapperCfg
.
path
,
&
vnodeCfg
);
if
(
pImpl
==
NULL
)
{
dError
(
"vgId:%d, failed to create vnode since %s"
,
pCreate
->
vgId
,
terrstr
());
return
-
1
;
}
int32_t
code
=
dndOpenVnode
(
pDnode
,
&
wrapperCfg
,
pImpl
);
if
(
code
!=
0
)
{
dError
(
"vgId:%d, failed to open vnode since %s"
,
pCreate
->
vgId
,
terrstr
());
vnodeClose
(
pImpl
);
vnodeDestroy
(
wrapperCfg
.
path
);
terrno
=
code
;
...
...
@@ -638,8 +641,8 @@ int32_t dndProcessCreateVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
return
0
;
}
int32_t
dndProcessAlterVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
)
{
SAlterVnode
Msg
*
pAlter
=
(
SAlterVnodeMsg
*
)
dndParseCreateVnodeReq
(
rpcMsg
);
int32_t
dndProcessAlterVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
SAlterVnode
Req
*
pAlter
=
(
SAlterVnodeReq
*
)
dndParseCreateVnodeReq
(
pReq
);
dDebug
(
"vgId:%d, alter vnode req is received"
,
pAlter
->
vgId
);
SVnodeCfg
vnodeCfg
=
{
0
};
...
...
@@ -651,7 +654,7 @@ int32_t dndProcessAlterVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
SVnodeObj
*
pVnode
=
dndAcquireVnode
(
pDnode
,
pAlter
->
vgId
);
if
(
pVnode
==
NULL
)
{
dDebug
(
"vgId:%d, failed to alter vnode since %s"
,
pAlter
->
vgId
,
terrstr
());
return
terrno
;
return
-
1
;
}
if
(
wrapperCfg
.
vgVersion
==
pVnode
->
vgVersion
)
{
...
...
@@ -663,7 +666,7 @@ int32_t dndProcessAlterVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
if
(
vnodeAlter
(
pVnode
->
pImpl
,
&
vnodeCfg
)
!=
0
)
{
dError
(
"vgId:%d, failed to alter vnode since %s"
,
pAlter
->
vgId
,
terrstr
());
dndReleaseVnode
(
pDnode
,
pVnode
);
return
terrno
;
return
-
1
;
}
int32_t
oldVersion
=
pVnode
->
vgVersion
;
...
...
@@ -677,8 +680,8 @@ int32_t dndProcessAlterVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
return
code
;
}
int32_t
dndProcessDropVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
)
{
SDropVnode
Msg
*
pDrop
=
vnodeParseDropVnodeReq
(
rpcMsg
);
int32_t
dndProcessDropVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
SDropVnode
Req
*
pDrop
=
vnodeParseDropVnodeReq
(
pReq
);
int32_t
vgId
=
pDrop
->
vgId
;
dDebug
(
"vgId:%d, drop vnode req is received"
,
vgId
);
...
...
@@ -686,13 +689,14 @@ int32_t dndProcessDropVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
SVnodeObj
*
pVnode
=
dndAcquireVnode
(
pDnode
,
vgId
);
if
(
pVnode
==
NULL
)
{
dDebug
(
"vgId:%d, failed to drop since %s"
,
vgId
,
terrstr
());
return
0
;
return
-
1
;
}
pVnode
->
dropped
=
1
;
if
(
dndWriteVnodesToFile
(
pDnode
)
!=
0
)
{
pVnode
->
dropped
=
0
;
return
terrno
;
dndReleaseVnode
(
pDnode
,
pVnode
);
return
-
1
;
}
dndReleaseVnode
(
pDnode
,
pVnode
);
...
...
@@ -704,10 +708,9 @@ int32_t dndProcessDropVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
return
0
;
}
int32_t
dndProcessAuthVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
)
{
SAuthVnode
Msg
*
pAuth
=
(
SAuthVnodeMsg
*
)
vnodeParseAuthVnodeReq
(
rpcMsg
);
int32_t
dndProcessAuthVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
SAuthVnode
Req
*
pAuth
=
(
SAuthVnodeReq
*
)
vnodeParseAuthVnodeReq
(
pReq
);
int32_t
code
=
0
;
int32_t
vgId
=
pAuth
->
vgId
;
dDebug
(
"vgId:%d, auth vnode req is received"
,
vgId
);
...
...
@@ -722,30 +725,30 @@ int32_t dndProcessAuthVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
return
0
;
}
int32_t
dndProcessSyncVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
)
{
S
AuthVnodeMsg
*
pAuth
=
(
SAuthVnodeMsg
*
)
vnodeParseAuthVnodeReq
(
rpcMsg
);
int32_t
dndProcessSyncVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
S
SyncVnodeReq
*
pSync
=
(
SSyncVnodeReq
*
)
vnodeParseDropVnodeReq
(
pReq
);
int32_t
vgId
=
p
Auth
->
vgId
;
dDebug
(
"vgId:%d,
auth
vnode req is received"
,
vgId
);
int32_t
vgId
=
p
Sync
->
vgId
;
dDebug
(
"vgId:%d,
sync
vnode req is received"
,
vgId
);
SVnodeObj
*
pVnode
=
dndAcquireVnode
(
pDnode
,
vgId
);
if
(
pVnode
==
NULL
)
{
dDebug
(
"vgId:%d, failed to
auth
since %s"
,
vgId
,
terrstr
());
return
terrno
;
dDebug
(
"vgId:%d, failed to
sync
since %s"
,
vgId
,
terrstr
());
return
-
1
;
}
if
(
vnodeSync
(
pVnode
->
pImpl
)
!=
0
)
{
dError
(
"vgId:%d, failed to
auth
vnode since %s"
,
vgId
,
terrstr
());
dError
(
"vgId:%d, failed to
sync
vnode since %s"
,
vgId
,
terrstr
());
dndReleaseVnode
(
pDnode
,
pVnode
);
return
terrno
;
return
-
1
;
}
dndReleaseVnode
(
pDnode
,
pVnode
);
return
0
;
}
int32_t
dndProcessCompactVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
rpcMsg
)
{
SCompactVnode
Msg
*
pCompact
=
(
SCompactVnodeMsg
*
)
vnodeParseDropVnodeReq
(
rpcMsg
);
int32_t
dndProcessCompactVnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
SCompactVnode
Req
*
pCompact
=
(
SCompactVnodeReq
*
)
vnodeParseDropVnodeReq
(
pReq
);
int32_t
vgId
=
pCompact
->
vgId
;
dDebug
(
"vgId:%d, compact vnode req is received"
,
vgId
);
...
...
@@ -753,13 +756,13 @@ int32_t dndProcessCompactVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
SVnodeObj
*
pVnode
=
dndAcquireVnode
(
pDnode
,
vgId
);
if
(
pVnode
==
NULL
)
{
dDebug
(
"vgId:%d, failed to compact since %s"
,
vgId
,
terrstr
());
return
terrno
;
return
-
1
;
}
if
(
vnodeCompact
(
pVnode
->
pImpl
)
!=
0
)
{
dError
(
"vgId:%d, failed to compact vnode since %s"
,
vgId
,
terrstr
());
dndReleaseVnode
(
pDnode
,
pVnode
);
return
terrno
;
return
-
1
;
}
dndReleaseVnode
(
pDnode
,
pVnode
);
...
...
source/dnode/mgmt/impl/test/vnode/vnode.cpp
浏览文件 @
33a60b60
...
...
@@ -28,9 +28,9 @@ Testbase DndTestVnode::test;
TEST_F
(
DndTestVnode
,
01
_Create_Restart_Drop_Vnode
)
{
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
int32_t
contLen
=
sizeof
(
SCreateVnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateVnode
Req
);
SCreateVnode
Msg
*
pReq
=
(
SCreateVnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateVnode
Req
*
pReq
=
(
SCreateVnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
vgId
=
htonl
(
2
);
pReq
->
dnodeId
=
htonl
(
1
);
strcpy
(
pReq
->
db
,
"1.d1"
);
...
...
@@ -68,9 +68,9 @@ TEST_F(DndTestVnode, 01_Create_Restart_Drop_Vnode) {
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
int32_t
contLen
=
sizeof
(
SAlterVnode
Msg
);
int32_t
contLen
=
sizeof
(
SAlterVnode
Req
);
SAlterVnode
Msg
*
pReq
=
(
SAlterVnodeMsg
*
)
rpcMallocCont
(
contLen
);
SAlterVnode
Req
*
pReq
=
(
SAlterVnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
vgId
=
htonl
(
2
);
pReq
->
dnodeId
=
htonl
(
1
);
strcpy
(
pReq
->
db
,
"1.d1"
);
...
...
@@ -108,9 +108,9 @@ TEST_F(DndTestVnode, 01_Create_Restart_Drop_Vnode) {
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
int32_t
contLen
=
sizeof
(
SDropVnode
Msg
);
int32_t
contLen
=
sizeof
(
SDropVnode
Req
);
SDropVnode
Msg
*
pReq
=
(
SDropVnodeMsg
*
)
rpcMallocCont
(
contLen
);
SDropVnode
Req
*
pReq
=
(
SDropVnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
vgId
=
htonl
(
2
);
pReq
->
dnodeId
=
htonl
(
1
);
strcpy
(
pReq
->
db
,
"1.d1"
);
...
...
@@ -118,7 +118,7 @@ TEST_F(DndTestVnode, 01_Create_Restart_Drop_Vnode) {
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
SDropVnode
Msg
);
rpcMsg
.
contLen
=
sizeof
(
SDropVnode
Req
);
rpcMsg
.
msgType
=
TDMT_DND_DROP_VNODE
;
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_DND_DROP_VNODE
,
pReq
,
contLen
);
...
...
source/dnode/mnode/impl/inc/mndVgroup.h
浏览文件 @
33a60b60
...
...
@@ -31,8 +31,8 @@ int32_t mndAllocVgroup(SMnode *pMnode, SDbObj *pDb, SVgObj **ppVgroups);
SEpSet
mndGetVgroupEpset
(
SMnode
*
pMnode
,
SVgObj
*
pVgroup
);
int32_t
mndGetVnodesNum
(
SMnode
*
pMnode
,
int32_t
dnodeId
);
SCreateVnode
Msg
*
mndBuildCreateVnodeMsg
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
);
SDropVnode
Msg
*
mndBuildDropVnodeMsg
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
);
SCreateVnode
Req
*
mndBuildCreateVnodeMsg
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
);
SDropVnode
Req
*
mndBuildDropVnodeMsg
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
);
#ifdef __cplusplus
}
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
33a60b60
...
...
@@ -331,11 +331,11 @@ static int32_t mndSetCreateDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
SCreateVnode
Msg
*
pMsg
=
mndBuildCreateVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
SCreateVnode
Req
*
pMsg
=
mndBuildCreateVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
if
(
pMsg
==
NULL
)
return
-
1
;
action
.
pCont
=
pMsg
;
action
.
contLen
=
sizeof
(
SCreateVnode
Msg
);
action
.
contLen
=
sizeof
(
SCreateVnode
Req
);
action
.
msgType
=
TDMT_DND_CREATE_VNODE
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pMsg
);
...
...
@@ -360,11 +360,11 @@ static int32_t mndSetCreateDbUndoActions(SMnode *pMnode, STrans *pTrans, SDbObj
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
SDropVnode
Msg
*
pMsg
=
mndBuildDropVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
SDropVnode
Req
*
pMsg
=
mndBuildDropVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
if
(
pMsg
==
NULL
)
return
-
1
;
action
.
pCont
=
pMsg
;
action
.
contLen
=
sizeof
(
SDropVnode
Msg
);
action
.
contLen
=
sizeof
(
SDropVnode
Req
);
action
.
msgType
=
TDMT_DND_DROP_VNODE
;
if
(
mndTransAppendUndoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pMsg
);
...
...
@@ -593,11 +593,11 @@ static int32_t mndBuildUpdateVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
SAlterVnode
Msg
*
pMsg
=
(
SAlterVnodeMsg
*
)
mndBuildCreateVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
SAlterVnode
Req
*
pMsg
=
(
SAlterVnodeReq
*
)
mndBuildCreateVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
if
(
pMsg
==
NULL
)
return
-
1
;
action
.
pCont
=
pMsg
;
action
.
contLen
=
sizeof
(
SAlterVnode
Msg
);
action
.
contLen
=
sizeof
(
SAlterVnode
Req
);
action
.
msgType
=
TDMT_DND_ALTER_VNODE
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pMsg
);
...
...
@@ -757,11 +757,11 @@ static int32_t mndBuildDropVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
SDropVnode
Msg
*
pMsg
=
mndBuildDropVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
SDropVnode
Req
*
pMsg
=
mndBuildDropVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
if
(
pMsg
==
NULL
)
return
-
1
;
action
.
pCont
=
pMsg
;
action
.
contLen
=
sizeof
(
SCreateVnode
Msg
);
action
.
contLen
=
sizeof
(
SCreateVnode
Req
);
action
.
msgType
=
TDMT_DND_DROP_VNODE
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pMsg
);
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
33a60b60
...
...
@@ -189,8 +189,8 @@ void mndReleaseVgroup(SMnode *pMnode, SVgObj *pVgroup) {
sdbRelease
(
pSdb
,
pVgroup
);
}
SCreateVnode
Msg
*
mndBuildCreateVnodeMsg
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
)
{
SCreateVnode
Msg
*
pCreate
=
calloc
(
1
,
sizeof
(
SCreateVnodeMsg
));
SCreateVnode
Req
*
mndBuildCreateVnodeMsg
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
)
{
SCreateVnode
Req
*
pCreate
=
calloc
(
1
,
sizeof
(
SCreateVnodeReq
));
if
(
pCreate
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
...
...
@@ -248,8 +248,8 @@ SCreateVnodeMsg *mndBuildCreateVnodeMsg(SMnode *pMnode, SDnodeObj *pDnode, SDbOb
return
pCreate
;
}
SDropVnode
Msg
*
mndBuildDropVnodeMsg
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
)
{
SDropVnode
Msg
*
pDrop
=
calloc
(
1
,
sizeof
(
SDropVnodeMsg
));
SDropVnode
Req
*
mndBuildDropVnodeMsg
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
)
{
SDropVnode
Req
*
pDrop
=
calloc
(
1
,
sizeof
(
SDropVnodeReq
));
if
(
pDrop
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
...
...
source/util/src/terror.c
浏览文件 @
33a60b60
...
...
@@ -277,9 +277,12 @@ 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_BNODE_READ_FILE_ERROR
,
"Read bnode.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_BNODE_WRITE_FILE_ERROR
,
"Write bnode.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_VNODE_TOO_MANY_VNODES
,
"Too many vnode directories"
)
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"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_VNODE_READ_FILE_ERROR
,
"Read vnodes.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_VNODE_WRITE_FILE_ERROR
,
"Write vnodes.json error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_VNODE_TOO_MANY_VNODES
,
"Too many vnodes"
)
// vnode
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_ACTION_IN_PROGRESS
,
"Action in progress"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录