Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6e523a47
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看板
提交
6e523a47
编写于
5月 14, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: multi-process mode
上级
84261149
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
21 addition
and
19 deletion
+21
-19
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
+1
-1
source/dnode/mgmt/node_mgmt/inc/dmMgmt.h
source/dnode/mgmt/node_mgmt/inc/dmMgmt.h
+0
-2
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
+10
-7
source/dnode/mgmt/node_mgmt/src/dmRun.c
source/dnode/mgmt/node_mgmt/src/dmRun.c
+2
-3
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+8
-6
未找到文件。
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
浏览文件 @
6e523a47
...
...
@@ -86,7 +86,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
SRpcMsg
rpcMsg
=
{.
pCont
=
pHead
,
.
contLen
=
contLen
,
.
msgType
=
TDMT_MND_STATUS
,
.
ahandle
=
(
void
*
)
0x9527
};
SRpcMsg
rpcRsp
=
{
0
};
dTrace
(
"send
req:%s to mnode, app:%p"
,
TMSG_INFO
(
rpcMsg
.
msgType
)
,
rpcMsg
.
ahandle
);
dTrace
(
"send
status msg to mnode, app:%p"
,
rpcMsg
.
ahandle
);
tmsgSendMnodeRecv
(
&
rpcMsg
,
&
rpcRsp
);
dmProcessStatusRsp
(
pMgmt
,
&
rpcRsp
);
}
...
...
source/dnode/mgmt/node_mgmt/inc/dmMgmt.h
浏览文件 @
6e523a47
...
...
@@ -125,8 +125,6 @@ typedef struct SDnode {
SDnodeTrans
trans
;
SUdfdData
udfdData
;
TdThreadMutex
mutex
;
SRWLatch
latch
;
SEpSet
mnodeEps
;
TdFilePtr
lockfile
;
SDnodeData
data
;
SMgmtWrapper
wrappers
[
NODE_END
];
...
...
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
浏览文件 @
6e523a47
...
...
@@ -32,6 +32,10 @@ static bool dmRequireNode(SMgmtWrapper *pWrapper) {
dDebug
(
"node:%s, does not require startup in child process"
,
pWrapper
->
name
);
}
if
(
required
)
{
dDebug
(
"node:%s, required to startup"
,
pWrapper
->
name
);
}
return
required
;
}
...
...
@@ -71,8 +75,8 @@ static int32_t dmInitVars(SDnode *pDnode, const SDnodeOpt *pOption) {
pData
->
disks
=
pOption
->
disks
;
pData
->
dataDir
=
strdup
(
pOption
->
dataDir
);
if
(
pData
->
dataDir
==
NULL
||
pData
->
localEp
==
NULL
||
pData
->
localFqdn
==
NULL
||
pData
->
firstEp
==
NULL
||
pData
->
secondEp
==
NULL
)
{
if
(
pData
->
dataDir
==
NULL
||
pData
->
localEp
==
NULL
||
pData
->
localFqdn
==
NULL
||
pData
->
firstEp
==
NULL
||
pData
->
secondEp
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
...
...
@@ -191,10 +195,6 @@ SDnode *dmCreate(const SDnodeOpt *pOption) {
goto
_OVER
;
}
if
(
dmInitClient
(
pDnode
)
!=
0
)
{
goto
_OVER
;
}
if
(
OnlyInSingleProc
(
pDnode
->
ptype
)
||
InParentProc
(
pDnode
->
ptype
))
{
pDnode
->
lockfile
=
dmCheckRunning
(
pOption
->
dataDir
);
if
(
pDnode
->
lockfile
==
NULL
)
{
...
...
@@ -207,6 +207,10 @@ SDnode *dmCreate(const SDnodeOpt *pOption) {
}
}
if
(
dmInitClient
(
pDnode
)
!=
0
)
{
goto
_OVER
;
}
dmReportStartup
(
pDnode
,
"dnode-transport"
,
"initialized"
);
dInfo
(
"dnode is created, data:%p"
,
pDnode
);
code
=
0
;
...
...
@@ -226,7 +230,6 @@ void dmClose(SDnode *pDnode) {
dmCleanupClient
(
pDnode
);
dmCleanupServer
(
pDnode
);
dmClearVars
(
pDnode
);
dInfo
(
"dnode is closed, data:%p"
,
pDnode
);
}
...
...
source/dnode/mgmt/node_mgmt/src/dmRun.c
浏览文件 @
6e523a47
...
...
@@ -144,9 +144,7 @@ int32_t dmOpenNode(SMgmtWrapper *pWrapper) {
}
int32_t
dmStartNode
(
SMgmtWrapper
*
pWrapper
)
{
if
(
!
pWrapper
->
required
)
return
0
;
if
(
OnlyInParentProc
(
pWrapper
->
proc
.
ptype
))
return
0
;
if
(
pWrapper
->
func
.
startFp
!=
NULL
&&
(
*
pWrapper
->
func
.
startFp
)(
pWrapper
->
pMgmt
)
!=
0
)
{
dError
(
"node:%s, failed to start since %s"
,
pWrapper
->
name
,
terrstr
());
return
-
1
;
...
...
@@ -201,6 +199,7 @@ static int32_t dmOpenNodes(SDnode *pDnode) {
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
ntype
];
if
(
!
pWrapper
->
required
)
continue
;
if
(
dmOpenNode
(
pWrapper
)
!=
0
)
{
dError
(
"node:%s, failed to open since %s"
,
pWrapper
->
name
,
terrstr
());
return
-
1
;
}
}
...
...
@@ -212,7 +211,7 @@ static int32_t dmOpenNodes(SDnode *pDnode) {
static
int32_t
dmStartNodes
(
SDnode
*
pDnode
)
{
for
(
EDndNodeType
ntype
=
DNODE
;
ntype
<
NODE_END
;
++
ntype
)
{
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
ntype
];
if
(
ntype
==
DNODE
&&
(
InChildProc
(
pDnode
->
ptype
)
||
!
OnlyInTestProc
(
pDnode
->
ptype
))
)
continue
;
if
(
!
pWrapper
->
required
)
continue
;
if
(
dmStartNode
(
pWrapper
)
!=
0
)
{
dError
(
"node:%s, failed to start since %s"
,
pWrapper
->
name
,
terrstr
());
return
-
1
;
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
6e523a47
...
...
@@ -22,21 +22,23 @@
#define INTERNAL_SECRET "_pwd"
static
void
dmGetMnodeEpSet
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
)
{
taosRLockLatch
(
&
pDnode
->
latch
);
*
pEpSet
=
pDnode
->
mnodeEps
;
taosRUnLockLatch
(
&
pDnode
->
latch
);
SDnodeData
*
pData
=
&
pDnode
->
data
;
taosRLockLatch
(
&
pData
->
latch
);
*
pEpSet
=
pData
->
mnodeEps
;
taosRUnLockLatch
(
&
pData
->
latch
);
}
static
void
dmSetMnodeEpSet
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
)
{
dInfo
(
"mnode is changed, num:%d use:%d"
,
pEpSet
->
numOfEps
,
pEpSet
->
inUse
);
SDnodeData
*
pData
=
&
pDnode
->
data
;
taosWLockLatch
(
&
pD
node
->
latch
);
pD
node
->
mnodeEps
=
*
pEpSet
;
taosWLockLatch
(
&
pD
ata
->
latch
);
pD
ata
->
mnodeEps
=
*
pEpSet
;
for
(
int32_t
i
=
0
;
i
<
pEpSet
->
numOfEps
;
++
i
)
{
dInfo
(
"mnode index:%d %s:%u"
,
i
,
pEpSet
->
eps
[
i
].
fqdn
,
pEpSet
->
eps
[
i
].
port
);
}
taosWUnLockLatch
(
&
pD
node
->
latch
);
taosWUnLockLatch
(
&
pD
ata
->
latch
);
}
static
inline
NodeMsgFp
dmGetMsgFp
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录