Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9f4d41fe
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看板
提交
9f4d41fe
编写于
5月 12, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: node mgmt
上级
bf2d1a79
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
32 addition
and
41 deletion
+32
-41
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
+0
-1
source/dnode/mgmt/mgmt_dnode/src/dmInt.c
source/dnode/mgmt/mgmt_dnode/src/dmInt.c
+9
-14
source/dnode/mgmt/node_mgmt/src/dmExec.c
source/dnode/mgmt/node_mgmt/src/dmExec.c
+3
-1
source/dnode/mgmt/node_util/inc/dmUtil.h
source/dnode/mgmt/node_util/inc/dmUtil.h
+20
-25
未找到文件。
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
浏览文件 @
9f4d41fe
...
...
@@ -88,7 +88,6 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
SMonMloadInfo
minfo
=
{
0
};
dmGetMnodeLoads
(
pMgmt
,
&
minfo
);
pMgmt
->
data
.
isMnode
=
minfo
.
isMnode
;
pMgmt
->
data
.
mndState
=
minfo
.
load
.
syncState
;
int32_t
contLen
=
tSerializeSStatusReq
(
NULL
,
0
,
&
req
);
...
...
source/dnode/mgmt/mgmt_dnode/src/dmInt.c
浏览文件 @
9f4d41fe
...
...
@@ -45,23 +45,18 @@ static int32_t dmOpenMgmt(const SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput)
pMgmt
->
data
.
updateTime
=
0
;
pMgmt
->
data
.
rebootTime
=
taosGetTimestampMs
();
pMgmt
->
data
.
dropped
=
0
;
pMgmt
->
data
.
localEp
=
strdup
(
pInput
->
localEp
);
pMgmt
->
data
.
localFqdn
=
strdup
(
pInput
->
localFqdn
);
pMgmt
->
data
.
firstEp
=
strdup
(
pInput
->
firstEp
);
pMgmt
->
data
.
secondEp
=
strdup
(
pInput
->
secondEp
);
pMgmt
->
data
.
dataDir
=
strdup
(
pInput
->
dataDir
);
pMgmt
->
data
.
disks
=
pInput
->
disks
;
pMgmt
->
data
.
numOfDisks
=
pInput
->
numOfDisks
;
pMgmt
->
data
.
localEp
=
pInput
->
localEp
;
pMgmt
->
data
.
localFqdn
=
pInput
->
localFqdn
;
pMgmt
->
data
.
firstEp
=
pInput
->
firstEp
;
pMgmt
->
data
.
secondEp
=
pInput
->
secondEp
;
pMgmt
->
data
.
supportVnodes
=
pInput
->
supportVnodes
;
pMgmt
->
data
.
serverPort
=
pInput
->
serverPort
;
pMgmt
->
pDnode
=
pInput
->
pDnode
;
pMgmt
->
processCreateNodeFp
=
pInput
->
processCreateNodeFp
;
pMgmt
->
processDropNodeFp
=
pInput
->
processDropNodeFp
;
pMgmt
->
isNodeDeployedFp
=
pInput
->
isNodeDeployedFp
;
taosInitRWLatch
(
&
pMgmt
->
data
.
latch
);
if
(
pMgmt
->
data
.
dataDir
==
NULL
||
pMgmt
->
data
.
localEp
==
NULL
||
pMgmt
->
data
.
localFqdn
==
NULL
||
pMgmt
->
data
.
firstEp
==
NULL
||
pMgmt
->
data
.
secondEp
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
pMgmt
->
data
.
dnodeHash
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
HASH_NO_LOCK
);
if
(
pMgmt
->
data
.
dnodeHash
==
NULL
)
{
dError
(
"failed to init dnode hash"
);
...
...
@@ -87,6 +82,7 @@ static int32_t dmOpenMgmt(const SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput)
dError
(
"failed to start udfd"
);
}
pOutput
->
pMgmt
=
pMgmt
;
dInfo
(
"dnode-mgmt is initialized"
);
return
0
;
}
...
...
@@ -110,7 +106,6 @@ static void dmCloseMgmt(SDnodeMgmt *pMgmt) {
taosMemoryFreeClear
(
pMgmt
->
data
.
localFqdn
);
taosMemoryFreeClear
(
pMgmt
->
data
.
firstEp
);
taosMemoryFreeClear
(
pMgmt
->
data
.
secondEp
);
taosMemoryFreeClear
(
pMgmt
->
data
.
dataDir
);
dInfo
(
"dnode-mgmt is cleaned up"
);
}
...
...
source/dnode/mgmt/node_mgmt/src/dmExec.c
浏览文件 @
9f4d41fe
...
...
@@ -228,7 +228,9 @@ static int32_t dmOpenNodes(SDnode *pDnode) {
}
else
{
pWrapper
->
procType
=
pDnode
->
ptype
;
}
return
dmOpenNode
(
pWrapper
);
if
(
dmOpenNode
(
pWrapper
)
!=
0
)
{
return
-
1
;
}
}
}
...
...
source/dnode/mgmt/node_util/inc/dmUtil.h
浏览文件 @
9f4d41fe
...
...
@@ -166,21 +166,16 @@ typedef struct {
int32_t
unsyncedVgId
;
ESyncState
vndState
;
ESyncState
mndState
;
bool
isMnode
;
bool
dropped
;
SEpSet
mnodeEps
;
SArray
*
dnodeEps
;
SHashObj
*
dnodeHash
;
SRWLatch
latch
;
SMsgCb
msgCb
;
TdFilePtr
lockfile
;
char
*
localEp
;
char
*
localFqdn
;
char
*
firstEp
;
char
*
secondEp
;
char
*
dataDir
;
SDiskCfg
*
disks
;
int32_t
numOfDisks
;
const
char
*
localEp
;
const
char
*
localFqdn
;
const
char
*
firstEp
;
const
char
*
secondEp
;
int32_t
supportVnodes
;
uint16_t
serverPort
;
}
SDnodeData
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录