Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
882575fd
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看板
提交
882575fd
编写于
3月 15, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
eb561f31
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
37 addition
and
20 deletion
+37
-20
source/dnode/mgmt/container/inc/dndInt.h
source/dnode/mgmt/container/inc/dndInt.h
+1
-1
source/dnode/mgmt/container/src/dndNode.c
source/dnode/mgmt/container/src/dndNode.c
+29
-8
source/dnode/mgmt/container/src/dndWorker.c
source/dnode/mgmt/container/src/dndWorker.c
+2
-0
source/dnode/mgmt/dnode/inc/dmInt.h
source/dnode/mgmt/dnode/inc/dmInt.h
+3
-0
source/dnode/mgmt/dnode/src/dmInt.c
source/dnode/mgmt/dnode/src/dmInt.c
+0
-9
source/dnode/mgmt/mnode/src/mmInt.c
source/dnode/mgmt/mnode/src/mmInt.c
+2
-2
未找到文件。
source/dnode/mgmt/container/inc/dndInt.h
浏览文件 @
882575fd
...
@@ -56,7 +56,7 @@ extern "C" {
...
@@ -56,7 +56,7 @@ extern "C" {
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
typedef
enum
{
VNODES
,
QNODE
,
SNODE
,
MNODE
,
BNODE
,
D
NODE
,
NODE_MAX
}
ENodeType
;
typedef
enum
{
DNODE
,
VNODES
,
QNODE
,
SNODE
,
MNODE
,
B
NODE
,
NODE_MAX
}
ENodeType
;
typedef
enum
{
PROC_SINGLE
,
PROC_CHILD
,
PROC_PARENT
}
EProcType
;
typedef
enum
{
PROC_SINGLE
,
PROC_CHILD
,
PROC_PARENT
}
EProcType
;
typedef
enum
{
DND_STAT_INIT
,
DND_STAT_RUNNING
,
DND_STAT_STOPPED
}
EDndStatus
;
typedef
enum
{
DND_STAT_INIT
,
DND_STAT_RUNNING
,
DND_STAT_STOPPED
}
EDndStatus
;
typedef
enum
{
DND_WORKER_SINGLE
,
DND_WORKER_MULTI
}
EWorkerType
;
typedef
enum
{
DND_WORKER_SINGLE
,
DND_WORKER_MULTI
}
EWorkerType
;
...
...
source/dnode/mgmt/container/src/dndNode.c
浏览文件 @
882575fd
...
@@ -121,14 +121,6 @@ SDnode *dndCreate(SDndCfg *pCfg) {
...
@@ -121,14 +121,6 @@ SDnode *dndCreate(SDndCfg *pCfg) {
}
}
pWrapper
->
procType
=
PROC_SINGLE
;
pWrapper
->
procType
=
PROC_SINGLE
;
pWrapper
->
required
=
dndRequireNode
(
pWrapper
);
if
(
pWrapper
->
required
)
{
if
(
taosMkDir
(
pWrapper
->
path
)
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
dError
(
"failed to create dir:%s since %s"
,
pWrapper
->
path
,
terrstr
());
goto
_OVER
;
}
}
}
}
code
=
0
;
code
=
0
;
...
@@ -172,8 +164,15 @@ static int32_t dndRunInSingleProcess(SDnode *pDnode) {
...
@@ -172,8 +164,15 @@ static int32_t dndRunInSingleProcess(SDnode *pDnode) {
for
(
ENodeType
n
=
0
;
n
<
NODE_MAX
;
++
n
)
{
for
(
ENodeType
n
=
0
;
n
<
NODE_MAX
;
++
n
)
{
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
n
];
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
n
];
pWrapper
->
required
=
dndRequireNode
(
pWrapper
);
if
(
!
pWrapper
->
required
)
continue
;
if
(
!
pWrapper
->
required
)
continue
;
if
(
taosMkDir
(
pWrapper
->
path
)
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
dError
(
"failed to create dir:%s since %s"
,
pWrapper
->
path
,
terrstr
());
return
-
1
;
}
dInfo
(
"node:%s, will start in single process"
,
pWrapper
->
name
);
dInfo
(
"node:%s, will start in single process"
,
pWrapper
->
name
);
pWrapper
->
procType
=
PROC_SINGLE
;
pWrapper
->
procType
=
PROC_SINGLE
;
if
(
dndOpenNode
(
pWrapper
)
!=
0
)
{
if
(
dndOpenNode
(
pWrapper
)
!=
0
)
{
...
@@ -182,6 +181,12 @@ static int32_t dndRunInSingleProcess(SDnode *pDnode) {
...
@@ -182,6 +181,12 @@ static int32_t dndRunInSingleProcess(SDnode *pDnode) {
}
}
}
}
SMgmtWrapper
*
pWrapper
=
dndGetWrapper
(
pDnode
,
DNODE
);
if
(
dmStartWorker
(
pWrapper
->
pMgmt
)
!=
0
)
{
dError
(
"failed to start dnode worker since %s"
,
terrstr
());
return
-
1
;
}
return
0
;
return
0
;
}
}
...
@@ -250,8 +255,15 @@ static int32_t dndRunInMultiProcess(SDnode *pDnode) {
...
@@ -250,8 +255,15 @@ static int32_t dndRunInMultiProcess(SDnode *pDnode) {
for
(
ENodeType
n
=
0
;
n
<
NODE_MAX
;
++
n
)
{
for
(
ENodeType
n
=
0
;
n
<
NODE_MAX
;
++
n
)
{
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
n
];
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
n
];
pWrapper
->
required
=
dndRequireNode
(
pWrapper
);
if
(
!
pWrapper
->
required
)
continue
;
if
(
!
pWrapper
->
required
)
continue
;
if
(
taosMkDir
(
pWrapper
->
path
)
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
dError
(
"failed to create dir:%s since %s"
,
pWrapper
->
path
,
terrstr
());
return
-
1
;
}
if
(
n
==
DNODE
)
{
if
(
n
==
DNODE
)
{
dInfo
(
"node:%s, will start in parent process"
,
pWrapper
->
name
);
dInfo
(
"node:%s, will start in parent process"
,
pWrapper
->
name
);
pWrapper
->
procType
=
PROC_SINGLE
;
pWrapper
->
procType
=
PROC_SINGLE
;
...
@@ -306,6 +318,12 @@ static int32_t dndRunInMultiProcess(SDnode *pDnode) {
...
@@ -306,6 +318,12 @@ static int32_t dndRunInMultiProcess(SDnode *pDnode) {
}
}
}
}
SMgmtWrapper
*
pWrapper
=
dndGetWrapper
(
pDnode
,
DNODE
);
if
(
pWrapper
->
procType
==
PROC_PARENT
&&
dmStartWorker
(
pWrapper
->
pMgmt
)
!=
0
)
{
dError
(
"failed to start dnode worker since %s"
,
terrstr
());
return
-
1
;
}
return
0
;
return
0
;
}
}
...
@@ -322,6 +340,9 @@ int32_t dndRun(SDnode *pDnode) {
...
@@ -322,6 +340,9 @@ int32_t dndRun(SDnode *pDnode) {
}
}
}
}
dndSetStatus
(
pDnode
,
DND_STAT_RUNNING
);
dndReportStartup
(
pDnode
,
"TDengine"
,
"initialized successfully"
);
while
(
1
)
{
while
(
1
)
{
if
(
pDnode
->
event
==
DND_EVENT_STOP
)
{
if
(
pDnode
->
event
==
DND_EVENT_STOP
)
{
dInfo
(
"dnode is about to stop"
);
dInfo
(
"dnode is about to stop"
);
...
...
source/dnode/mgmt/container/src/dndWorker.c
浏览文件 @
882575fd
...
@@ -65,6 +65,8 @@ int32_t dndInitWorker(void *param, SDnodeWorker *pWorker, EWorkerType type, cons
...
@@ -65,6 +65,8 @@ int32_t dndInitWorker(void *param, SDnodeWorker *pWorker, EWorkerType type, cons
}
}
void
dndCleanupWorker
(
SDnodeWorker
*
pWorker
)
{
void
dndCleanupWorker
(
SDnodeWorker
*
pWorker
)
{
if
(
pWorker
->
queue
==
NULL
)
return
;
while
(
!
taosQueueEmpty
(
pWorker
->
queue
))
{
while
(
!
taosQueueEmpty
(
pWorker
->
queue
))
{
taosMsleep
(
10
);
taosMsleep
(
10
);
}
}
...
...
source/dnode/mgmt/dnode/inc/dmInt.h
浏览文件 @
882575fd
...
@@ -51,6 +51,9 @@ void dmUpdateMnodeEpSet(SDnode *pDnode, SEpSet *pEpSet);
...
@@ -51,6 +51,9 @@ void dmUpdateMnodeEpSet(SDnode *pDnode, SEpSet *pEpSet);
void
dmGetDnodeEp
(
SDnode
*
pDnode
,
int32_t
dnodeId
,
char
*
pEp
,
char
*
pFqdn
,
uint16_t
*
pPort
);
void
dmGetDnodeEp
(
SDnode
*
pDnode
,
int32_t
dnodeId
,
char
*
pEp
,
char
*
pFqdn
,
uint16_t
*
pPort
);
void
dmSendRedirectRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
void
dmSendRedirectRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
// dmWorker.h
int32_t
dmStartWorker
(
SDnodeMgmt
*
pMgmt
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
source/dnode/mgmt/dnode/src/dmInt.c
浏览文件 @
882575fd
...
@@ -136,17 +136,8 @@ int32_t dmInit(SMgmtWrapper *pWrapper) {
...
@@ -136,17 +136,8 @@ int32_t dmInit(SMgmtWrapper *pWrapper) {
return
-
1
;
return
-
1
;
}
}
if
(
dmStartWorker
(
pMgmt
)
!=
0
)
{
dError
(
"failed to start dnode worker since %s"
,
terrstr
());
return
-
1
;
}
pWrapper
->
pMgmt
=
pMgmt
;
pWrapper
->
pMgmt
=
pMgmt
;
dInfo
(
"dnode-mgmt is initialized"
);
dInfo
(
"dnode-mgmt is initialized"
);
dndSetStatus
(
pDnode
,
DND_STAT_RUNNING
);
dmSendStatusReq
(
pMgmt
);
dndReportStartup
(
pDnode
,
"TDengine"
,
"initialized successfully"
);
return
0
;
return
0
;
}
}
...
...
source/dnode/mgmt/mnode/src/mmInt.c
浏览文件 @
882575fd
...
@@ -200,7 +200,7 @@ static void mmCleanup(SMgmtWrapper *pWrapper) {
...
@@ -200,7 +200,7 @@ static void mmCleanup(SMgmtWrapper *pWrapper) {
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
if
(
pMgmt
==
NULL
)
return
;
if
(
pMgmt
==
NULL
)
return
;
dInfo
(
"mnode-mgmt start to clean
up"
);
dInfo
(
"mnode-mgmt start to cleanup"
);
if
(
pMgmt
->
pMnode
)
{
if
(
pMgmt
->
pMnode
)
{
mmStopWorker
(
pMgmt
);
mmStopWorker
(
pMgmt
);
mndClose
(
pMgmt
->
pMnode
);
mndClose
(
pMgmt
->
pMnode
);
...
@@ -217,7 +217,7 @@ static int32_t mmInit(SMgmtWrapper *pWrapper) {
...
@@ -217,7 +217,7 @@ static int32_t mmInit(SMgmtWrapper *pWrapper) {
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
SMnodeOpt
option
=
{
0
};
SMnodeOpt
option
=
{
0
};
dInfo
(
"mnode-mgmt
is initialized
"
);
dInfo
(
"mnode-mgmt
start to init
"
);
pMgmt
->
path
=
pWrapper
->
path
;
pMgmt
->
path
=
pWrapper
->
path
;
pMgmt
->
pDnode
=
pWrapper
->
pDnode
;
pMgmt
->
pDnode
=
pWrapper
->
pDnode
;
pMgmt
->
pWrapper
=
pWrapper
;
pMgmt
->
pWrapper
=
pWrapper
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录