Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b16a21b2
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b16a21b2
编写于
5月 17, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: multi-process test mode
上级
0a1e96ec
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
29 addition
and
22 deletion
+29
-22
source/dnode/mgmt/mgmt_bnode/inc/bmInt.h
source/dnode/mgmt/mgmt_bnode/inc/bmInt.h
+1
-1
source/dnode/mgmt/mgmt_bnode/src/bmHandle.c
source/dnode/mgmt/mgmt_bnode/src/bmHandle.c
+3
-3
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
+1
-1
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+7
-3
source/dnode/mgmt/mgmt_qnode/inc/qmInt.h
source/dnode/mgmt/mgmt_qnode/inc/qmInt.h
+1
-1
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
+3
-3
source/dnode/mgmt/mgmt_snode/inc/smInt.h
source/dnode/mgmt/mgmt_snode/inc/smInt.h
+1
-1
source/dnode/mgmt/mgmt_snode/src/smHandle.c
source/dnode/mgmt/mgmt_snode/src/smHandle.c
+3
-3
source/dnode/mgmt/node_mgmt/src/dmEnv.c
source/dnode/mgmt/node_mgmt/src/dmEnv.c
+8
-5
source/dnode/mgmt/node_util/inc/dmUtil.h
source/dnode/mgmt/node_util/inc/dmUtil.h
+1
-1
未找到文件。
source/dnode/mgmt/mgmt_bnode/inc/bmInt.h
浏览文件 @
b16a21b2
...
...
@@ -37,7 +37,7 @@ typedef struct SBnodeMgmt {
// bmHandle.c
SArray
*
bmGetMsgHandles
();
int32_t
bmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pReq
);
int32_t
bmProcessDropReq
(
SBnodeMgmt
*
pMgm
t
,
SRpcMsg
*
pReq
);
int32_t
bmProcessDropReq
(
const
SMgmtInputOpt
*
pInpu
t
,
SRpcMsg
*
pReq
);
int32_t
bmProcessGetMonBmInfoReq
(
SBnodeMgmt
*
pMgmt
,
SRpcMsg
*
pReq
);
// bmWorker.c
...
...
source/dnode/mgmt/mgmt_bnode/src/bmHandle.c
浏览文件 @
b16a21b2
...
...
@@ -67,7 +67,7 @@ int32_t bmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
return
0
;
}
int32_t
bmProcessDropReq
(
SBnodeMgmt
*
pMgm
t
,
SRpcMsg
*
pMsg
)
{
int32_t
bmProcessDropReq
(
const
SMgmtInputOpt
*
pInpu
t
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDDropBnodeReq
dropReq
=
{
0
};
...
...
@@ -76,14 +76,14 @@ int32_t bmProcessDropReq(SBnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
if
(
p
Mgmt
->
pData
->
dnodeId
!=
0
&&
dropReq
.
dnodeId
!=
pMgm
t
->
pData
->
dnodeId
)
{
if
(
p
Input
->
pData
->
dnodeId
!=
0
&&
dropReq
.
dnodeId
!=
pInpu
t
->
pData
->
dnodeId
)
{
terrno
=
TSDB_CODE_INVALID_OPTION
;
dError
(
"failed to drop bnode since %s"
,
terrstr
());
return
-
1
;
}
bool
deployed
=
false
;
if
(
dmWriteFile
(
p
Mgmt
->
path
,
pMgm
t
->
name
,
deployed
)
!=
0
)
{
if
(
dmWriteFile
(
p
Input
->
path
,
pInpu
t
->
name
,
deployed
)
!=
0
)
{
dError
(
"failed to write bnode file since %s"
,
terrstr
());
return
-
1
;
}
...
...
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
浏览文件 @
b16a21b2
...
...
@@ -49,7 +49,7 @@ int32_t mmAlter(SMnodeMgmt *pMgmt, SDAlterMnodeReq *pReq);
// mmHandle.c
SArray
*
mmGetMsgHandles
();
int32_t
mmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessDropReq
(
SMnodeMgmt
*
pMgm
t
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessDropReq
(
const
SMgmtInputOpt
*
pInpu
t
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessAlterReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
mmProcessGetMonitorInfoReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pReq
);
int32_t
mmProcessGetLoadsReq
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pReq
);
...
...
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
浏览文件 @
b16a21b2
...
...
@@ -100,7 +100,7 @@ int32_t mmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
return
0
;
}
int32_t
mmProcessDropReq
(
SMnodeMgmt
*
pMgm
t
,
SRpcMsg
*
pMsg
)
{
int32_t
mmProcessDropReq
(
const
SMgmtInputOpt
*
pInpu
t
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDDropMnodeReq
dropReq
=
{
0
};
...
...
@@ -109,14 +109,18 @@ int32_t mmProcessDropReq(SMnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
if
(
p
Mgmt
->
pData
->
dnodeId
!=
0
&&
dropReq
.
dnodeId
!=
pMgm
t
->
pData
->
dnodeId
)
{
if
(
p
Input
->
pData
->
dnodeId
!=
0
&&
dropReq
.
dnodeId
!=
pInpu
t
->
pData
->
dnodeId
)
{
terrno
=
TSDB_CODE_INVALID_OPTION
;
dError
(
"failed to drop mnode since %s"
,
terrstr
());
return
-
1
;
}
bool
deployed
=
false
;
if
(
mmWriteFile
(
pMgmt
,
NULL
,
deployed
)
!=
0
)
{
SMnodeMgmt
mgmt
=
{
0
};
mgmt
.
path
=
pInput
->
path
;
mgmt
.
name
=
pInput
->
name
;
if
(
mmWriteFile
(
&
mgmt
,
NULL
,
deployed
)
!=
0
)
{
dError
(
"failed to write mnode file since %s"
,
terrstr
());
return
-
1
;
}
...
...
source/dnode/mgmt/mgmt_qnode/inc/qmInt.h
浏览文件 @
b16a21b2
...
...
@@ -38,7 +38,7 @@ typedef struct SQnodeMgmt {
// qmHandle.c
SArray
*
qmGetMsgHandles
();
int32_t
qmProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
qmProcessDropReq
(
SQnodeMgmt
*
pMgm
t
,
SRpcMsg
*
pMsg
);
int32_t
qmProcessDropReq
(
const
SMgmtInputOpt
*
pInpu
t
,
SRpcMsg
*
pMsg
);
int32_t
qmProcessGetMonitorInfoReq
(
SQnodeMgmt
*
pMgmt
,
SRpcMsg
*
pReq
);
// qmWorker.c
...
...
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
浏览文件 @
b16a21b2
...
...
@@ -67,7 +67,7 @@ int32_t qmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
return
0
;
}
int32_t
qmProcessDropReq
(
SQnodeMgmt
*
pMgm
t
,
SRpcMsg
*
pMsg
)
{
int32_t
qmProcessDropReq
(
const
SMgmtInputOpt
*
pInpu
t
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDDropQnodeReq
dropReq
=
{
0
};
...
...
@@ -76,14 +76,14 @@ int32_t qmProcessDropReq(SQnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
if
(
p
Mgmt
->
pData
->
dnodeId
!=
0
&&
dropReq
.
dnodeId
!=
pMgm
t
->
pData
->
dnodeId
)
{
if
(
p
Input
->
pData
->
dnodeId
!=
0
&&
dropReq
.
dnodeId
!=
pInpu
t
->
pData
->
dnodeId
)
{
terrno
=
TSDB_CODE_INVALID_OPTION
;
dError
(
"failed to drop qnode since %s"
,
terrstr
());
return
-
1
;
}
bool
deployed
=
false
;
if
(
dmWriteFile
(
p
Mgmt
->
path
,
pMgm
t
->
name
,
deployed
)
!=
0
)
{
if
(
dmWriteFile
(
p
Input
->
path
,
pInpu
t
->
name
,
deployed
)
!=
0
)
{
dError
(
"failed to write qnode file since %s"
,
terrstr
());
return
-
1
;
}
...
...
source/dnode/mgmt/mgmt_snode/inc/smInt.h
浏览文件 @
b16a21b2
...
...
@@ -40,7 +40,7 @@ typedef struct SSnodeMgmt {
// smHandle.c
SArray
*
smGetMsgHandles
();
int32_t
smProcessCreateReq
(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
int32_t
smProcessDropReq
(
SSnodeMgmt
*
pMgm
t
,
SRpcMsg
*
pMsg
);
int32_t
smProcessDropReq
(
const
SMgmtInputOpt
*
pInpu
t
,
SRpcMsg
*
pMsg
);
int32_t
smProcessGetMonitorInfoReq
(
SSnodeMgmt
*
pMgmt
,
SRpcMsg
*
pReq
);
// smWorker.c
...
...
source/dnode/mgmt/mgmt_snode/src/smHandle.c
浏览文件 @
b16a21b2
...
...
@@ -67,7 +67,7 @@ int32_t smProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) {
return
0
;
}
int32_t
smProcessDropReq
(
SSnodeMgmt
*
pMgm
t
,
SRpcMsg
*
pMsg
)
{
int32_t
smProcessDropReq
(
const
SMgmtInputOpt
*
pInpu
t
,
SRpcMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
pMsg
;
SDDropSnodeReq
dropReq
=
{
0
};
...
...
@@ -76,14 +76,14 @@ int32_t smProcessDropReq(SSnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
if
(
p
Mgmt
->
pData
->
dnodeId
!=
0
&&
dropReq
.
dnodeId
!=
pMgm
t
->
pData
->
dnodeId
)
{
if
(
p
Input
->
pData
->
dnodeId
!=
0
&&
dropReq
.
dnodeId
!=
pInpu
t
->
pData
->
dnodeId
)
{
terrno
=
TSDB_CODE_INVALID_OPTION
;
dError
(
"failed to drop snode since %s"
,
terrstr
());
return
-
1
;
}
bool
deployed
=
false
;
if
(
dmWriteFile
(
p
Mgmt
->
path
,
pMgm
t
->
name
,
deployed
)
!=
0
)
{
if
(
dmWriteFile
(
p
Input
->
path
,
pInpu
t
->
name
,
deployed
)
!=
0
)
{
dError
(
"failed to write snode file since %s"
,
terrstr
());
return
-
1
;
}
...
...
source/dnode/mgmt/node_mgmt/src/dmEnv.c
浏览文件 @
b16a21b2
...
...
@@ -106,22 +106,23 @@ static int32_t dmProcessCreateNodeReq(EDndNodeType ntype, SRpcMsg *pMsg) {
return
-
1
;
}
taosThreadMutexLock
(
&
pDnode
->
mutex
);
pWrapper
=
&
pDnode
->
wrappers
[
ntype
];
if
(
taosMkDir
(
pWrapper
->
path
)
!=
0
)
{
dmReleaseWrapper
(
pWrapper
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
dError
(
"failed to create dir:%s since %s"
,
pWrapper
->
path
,
terrstr
());
return
-
1
;
}
taosThreadMutexLock
(
&
pDnode
->
mutex
);
SMgmtInputOpt
input
=
dmBuildMgmtInputOpt
(
pWrapper
);
dInfo
(
"node:%s, start to create"
,
pWrapper
->
name
);
int32_t
code
=
(
*
pWrapper
->
func
.
createFp
)(
&
input
,
pMsg
);
if
(
code
!=
0
)
{
dError
(
"node:%s, failed to create since %s"
,
pWrapper
->
name
,
terrstr
());
}
else
{
d
Debug
(
"node:%s, has been created"
,
pWrapper
->
name
);
d
Info
(
"node:%s, has been created"
,
pWrapper
->
name
);
(
void
)
dmOpenNode
(
pWrapper
);
pWrapper
->
required
=
true
;
pWrapper
->
deployed
=
true
;
...
...
@@ -143,12 +144,14 @@ static int32_t dmProcessDropNodeReq(EDndNodeType ntype, SRpcMsg *pMsg) {
}
taosThreadMutexLock
(
&
pDnode
->
mutex
);
SMgmtInputOpt
input
=
dmBuildMgmtInputOpt
(
pWrapper
);
int32_t
code
=
(
*
pWrapper
->
func
.
dropFp
)(
pWrapper
->
pMgmt
,
pMsg
);
dInfo
(
"node:%s, start to drop"
,
pWrapper
->
name
);
int32_t
code
=
(
*
pWrapper
->
func
.
dropFp
)(
&
input
,
pMsg
);
if
(
code
!=
0
)
{
dError
(
"node:%s, failed to drop since %s"
,
pWrapper
->
name
,
terrstr
());
}
else
{
d
Debug
(
"node:%s, has been dropped"
,
pWrapper
->
name
);
d
Info
(
"node:%s, has been dropped"
,
pWrapper
->
name
);
pWrapper
->
required
=
false
;
pWrapper
->
deployed
=
false
;
}
...
...
source/dnode/mgmt/node_util/inc/dmUtil.h
浏览文件 @
b16a21b2
...
...
@@ -126,7 +126,7 @@ typedef void (*NodeCloseFp)(void *pMgmt);
typedef
int32_t
(
*
NodeStartFp
)(
void
*
pMgmt
);
typedef
void
(
*
NodeStopFp
)(
void
*
pMgmt
);
typedef
int32_t
(
*
NodeCreateFp
)(
const
SMgmtInputOpt
*
pInput
,
SRpcMsg
*
pMsg
);
typedef
int32_t
(
*
NodeDropFp
)(
void
*
pMgm
t
,
SRpcMsg
*
pMsg
);
typedef
int32_t
(
*
NodeDropFp
)(
const
SMgmtInputOpt
*
pInpu
t
,
SRpcMsg
*
pMsg
);
typedef
int32_t
(
*
NodeRequireFp
)(
const
SMgmtInputOpt
*
pInput
,
bool
*
required
);
typedef
SArray
*
(
*
NodeGetHandlesFp
)();
// array of SMgmtHandle
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录