Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
99cb481b
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
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看板
提交
99cb481b
编写于
11月 04, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
da1bf2a2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
42 addition
and
55 deletion
+42
-55
include/server/mnode/mnode.h
include/server/mnode/mnode.h
+5
-9
source/dnode/mgmt/src/dnodeMnode.c
source/dnode/mgmt/src/dnodeMnode.c
+3
-4
source/dnode/mnode/inc/mnodeInt.h
source/dnode/mnode/inc/mnodeInt.h
+0
-1
source/dnode/mnode/src/mnodeTelem.c
source/dnode/mnode/src/mnodeTelem.c
+12
-12
source/dnode/mnode/src/mondeInt.c
source/dnode/mnode/src/mondeInt.c
+22
-29
未找到文件。
include/server/mnode/mnode.h
浏览文件 @
99cb481b
...
@@ -31,29 +31,25 @@ typedef struct {
...
@@ -31,29 +31,25 @@ typedef struct {
int64_t
totalPoints
;
int64_t
totalPoints
;
int64_t
totalStorage
;
int64_t
totalStorage
;
int64_t
compStorage
;
int64_t
compStorage
;
}
SMnode
Stat
;
}
SMnode
Load
;
typedef
struct
{
typedef
struct
{
int32_t
dnodeId
;
int64_t
clusterId
;
void
(
*
SendMsgToDnode
)(
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
void
(
*
SendMsgToDnode
)(
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
void
(
*
SendMsgToMnode
)(
struct
SRpcMsg
*
rpcMsg
);
void
(
*
SendMsgToMnode
)(
struct
SRpcMsg
*
rpcMsg
);
void
(
*
SendRedirectMsg
)(
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
);
void
(
*
SendRedirectMsg
)(
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
);
void
(
*
GetDnodeEp
)(
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
}
SMnodeFp
;
typedef
struct
{
SMnodeFp
fp
;
int64_t
clusterId
;
int32_t
dnodeId
;
}
SMnodePara
;
}
SMnodePara
;
int32_t
mnodeInit
(
SMnodePara
para
);
int32_t
mnodeInit
(
SMnodePara
para
);
void
mnodeCleanup
();
void
mnodeCleanup
();
int32_t
mnodeDeploy
();
int32_t
mnodeDeploy
();
void
mnodeUnDeploy
();
void
mnodeUnDeploy
();
int32_t
mnodeStart
();
int32_t
mnodeStart
();
void
mnodeStop
();
void
mnodeStop
();
int32_t
mnodeGet
Statistics
(
SMnodeStat
*
stat
);
int32_t
mnodeGet
Load
(
SMnodeLoad
*
pLoad
);
int32_t
mnodeRetriveAuth
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
int32_t
mnodeRetriveAuth
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
void
mnodeProcessMsg
(
SRpcMsg
*
rpcMsg
);
void
mnodeProcessMsg
(
SRpcMsg
*
rpcMsg
);
...
...
source/dnode/mgmt/src/dnodeMnode.c
浏览文件 @
99cb481b
...
@@ -223,10 +223,9 @@ int32_t dnodeInitMnode() {
...
@@ -223,10 +223,9 @@ int32_t dnodeInitMnode() {
snprintf
(
tsMnode
.
file
,
sizeof
(
tsMnode
.
file
),
"%s/mnode.json"
,
tsDnodeDir
);
snprintf
(
tsMnode
.
file
,
sizeof
(
tsMnode
.
file
),
"%s/mnode.json"
,
tsDnodeDir
);
SMnodePara
para
;
SMnodePara
para
;
para
.
fp
.
GetDnodeEp
=
dnodeGetDnodeEp
;
para
.
SendMsgToDnode
=
dnodeSendMsgToDnode
;
para
.
fp
.
SendMsgToDnode
=
dnodeSendMsgToDnode
;
para
.
SendMsgToMnode
=
dnodeSendMsgToMnode
;
para
.
fp
.
SendMsgToMnode
=
dnodeSendMsgToMnode
;
para
.
SendRedirectMsg
=
dnodeSendRedirectMsg
;
para
.
fp
.
SendRedirectMsg
=
dnodeSendRedirectMsg
;
para
.
dnodeId
=
dnodeGetDnodeId
();
para
.
dnodeId
=
dnodeGetDnodeId
();
para
.
clusterId
=
dnodeGetClusterId
();
para
.
clusterId
=
dnodeGetClusterId
();
...
...
source/dnode/mnode/inc/mnodeInt.h
浏览文件 @
99cb481b
...
@@ -32,7 +32,6 @@ EMnStatus mnodeGetStatus();
...
@@ -32,7 +32,6 @@ EMnStatus mnodeGetStatus();
void
mnodeSendMsgToDnode
(
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
void
mnodeSendMsgToDnode
(
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
void
mnodeSendMsgToMnode
(
struct
SRpcMsg
*
rpcMsg
);
void
mnodeSendMsgToMnode
(
struct
SRpcMsg
*
rpcMsg
);
void
mnodeSendRedirectMsg
(
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
);
void
mnodeSendRedirectMsg
(
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
);
void
mnodeGetDnodeEp
(
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/dnode/mnode/src/mnodeTelem.c
浏览文件 @
99cb481b
...
@@ -172,21 +172,21 @@ static void mnodeAddVersionInfo(SBufferWriter* bw) {
...
@@ -172,21 +172,21 @@ static void mnodeAddVersionInfo(SBufferWriter* bw) {
}
}
static
void
mnodeAddRuntimeInfo
(
SBufferWriter
*
bw
)
{
static
void
mnodeAddRuntimeInfo
(
SBufferWriter
*
bw
)
{
SMnode
Stat
stat
=
{
0
};
SMnode
Load
load
=
{
0
};
if
(
mnodeGet
Statistics
(
&
stat
)
!=
0
)
{
if
(
mnodeGet
Load
(
&
load
)
!=
0
)
{
return
;
return
;
}
}
mnodeAddIntField
(
bw
,
"numOfDnode"
,
stat
.
numOfDnode
);
mnodeAddIntField
(
bw
,
"numOfDnode"
,
load
.
numOfDnode
);
mnodeAddIntField
(
bw
,
"numOfMnode"
,
stat
.
numOfMnode
);
mnodeAddIntField
(
bw
,
"numOfMnode"
,
load
.
numOfMnode
);
mnodeAddIntField
(
bw
,
"numOfVgroup"
,
stat
.
numOfVgroup
);
mnodeAddIntField
(
bw
,
"numOfVgroup"
,
load
.
numOfVgroup
);
mnodeAddIntField
(
bw
,
"numOfDatabase"
,
stat
.
numOfDatabase
);
mnodeAddIntField
(
bw
,
"numOfDatabase"
,
load
.
numOfDatabase
);
mnodeAddIntField
(
bw
,
"numOfSuperTable"
,
stat
.
numOfSuperTable
);
mnodeAddIntField
(
bw
,
"numOfSuperTable"
,
load
.
numOfSuperTable
);
mnodeAddIntField
(
bw
,
"numOfChildTable"
,
stat
.
numOfChildTable
);
mnodeAddIntField
(
bw
,
"numOfChildTable"
,
load
.
numOfChildTable
);
mnodeAddIntField
(
bw
,
"numOfColumn"
,
stat
.
numOfColumn
);
mnodeAddIntField
(
bw
,
"numOfColumn"
,
load
.
numOfColumn
);
mnodeAddIntField
(
bw
,
"numOfPoint"
,
stat
.
totalPoints
);
mnodeAddIntField
(
bw
,
"numOfPoint"
,
load
.
totalPoints
);
mnodeAddIntField
(
bw
,
"totalStorage"
,
stat
.
totalStorage
);
mnodeAddIntField
(
bw
,
"totalStorage"
,
load
.
totalStorage
);
mnodeAddIntField
(
bw
,
"compStorage"
,
stat
.
compStorage
);
mnodeAddIntField
(
bw
,
"compStorage"
,
load
.
compStorage
);
}
}
static
void
mnodeSendTelemetryReport
()
{
static
void
mnodeSendTelemetryReport
()
{
...
...
source/dnode/mnode/src/mondeInt.c
浏览文件 @
99cb481b
...
@@ -37,48 +37,41 @@
...
@@ -37,48 +37,41 @@
#include "mnodeTelem.h"
#include "mnodeTelem.h"
static
struct
{
static
struct
{
int32_t
state
;
int32_t
state
;
int32_t
dnodeId
;
int32_t
dnodeId
;
int64_t
clusterId
;
int64_t
clusterId
;
tmr_h
timer
;
tmr_h
timer
;
S
MnodeFp
fp
;
S
Steps
*
steps1
;
SSteps
*
steps1
;
SSteps
*
steps2
;
S
Steps
*
steps2
;
S
MnodePara
para
;
}
tsMint
;
}
tsMint
;
tmr_h
mnodeGetTimer
()
{
return
tsMint
.
timer
;
}
tmr_h
mnodeGetTimer
()
{
return
tsMint
.
timer
;
}
int32_t
mnodeGetDnodeId
()
{
return
tsMint
.
dnodeId
;
}
int32_t
mnodeGetDnodeId
()
{
return
tsMint
.
para
.
dnodeId
;
}
int64_t
mnodeGetClusterId
()
{
return
tsMint
.
clusterId
;
}
int64_t
mnodeGetClusterId
()
{
return
tsMint
.
para
.
clusterId
;
}
EMnStatus
mnodeGetStatus
()
{
return
tsMint
.
state
;
}
EMnStatus
mnodeGetStatus
()
{
return
tsMint
.
state
;
}
void
mnodeSendMsgToDnode
(
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
)
{
void
mnodeSendMsgToDnode
(
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
)
{
(
*
tsMint
.
fp
.
SendMsgToDnode
)(
epSet
,
rpcMsg
);
(
*
tsMint
.
para
.
SendMsgToDnode
)(
epSet
,
rpcMsg
);
}
}
void
mnodeSendMsgToMnode
(
struct
SRpcMsg
*
rpcMsg
)
{
return
(
*
tsMint
.
fp
.
SendMsgToMnode
)(
rpcMsg
);
}
void
mnodeSendMsgToMnode
(
struct
SRpcMsg
*
rpcMsg
)
{
return
(
*
tsMint
.
para
.
SendMsgToMnode
)(
rpcMsg
);
}
void
mnodeSendRedirectMsg
(
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
)
{
(
*
tsMint
.
fp
.
SendRedirectMsg
)(
rpcMsg
,
forShell
);
}
void
mnodeSendRedirectMsg
(
struct
SRpcMsg
*
rpcMsg
,
bool
forShell
)
{
(
*
tsMint
.
para
.
SendRedirectMsg
)(
rpcMsg
,
forShell
);
}
void
mnodeGetDnodeEp
(
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
)
{
int32_t
mnodeGetLoad
(
SMnodeLoad
*
pLoad
)
{
return
0
;
}
(
*
tsMint
.
fp
.
GetDnodeEp
)(
dnodeId
,
ep
,
fqdn
,
port
);
}
int32_t
mnodeGetStatistics
(
SMnodeStat
*
stat
)
{
return
0
;
}
static
int32_t
mnodeSetPara
(
SMnodePara
para
)
{
static
int32_t
mnodeSetPara
(
SMnodePara
para
)
{
tsMint
.
fp
=
para
.
fp
;
tsMint
.
para
=
para
;
tsMint
.
dnodeId
=
para
.
dnodeId
;
tsMint
.
clusterId
=
para
.
clusterId
;
if
(
tsMint
.
fp
.
SendMsgToDnode
==
NULL
)
return
-
1
;
if
(
tsMint
.
para
.
SendMsgToDnode
==
NULL
)
return
-
1
;
if
(
tsMint
.
fp
.
SendMsgToMnode
==
NULL
)
return
-
1
;
if
(
tsMint
.
para
.
SendMsgToMnode
==
NULL
)
return
-
1
;
if
(
tsMint
.
fp
.
SendRedirectMsg
==
NULL
)
return
-
1
;
if
(
tsMint
.
para
.
SendRedirectMsg
==
NULL
)
return
-
1
;
if
(
tsMint
.
fp
.
GetDnodeEp
==
NULL
)
return
-
1
;
if
(
tsMint
.
para
.
dnodeId
<
0
)
return
-
1
;
if
(
tsMint
.
dnodeId
<
0
)
return
-
1
;
if
(
tsMint
.
para
.
clusterId
<
0
)
return
-
1
;
if
(
tsMint
.
clusterId
<
0
)
return
-
1
;
return
0
;
return
0
;
}
}
...
@@ -142,8 +135,8 @@ static void mnodeCleanupStep1() { taosStepCleanup(tsMint.steps1); }
...
@@ -142,8 +135,8 @@ static void mnodeCleanupStep1() { taosStepCleanup(tsMint.steps1); }
static
void
mnodeCleanupStep2
()
{
taosStepCleanup
(
tsMint
.
steps2
);
}
static
void
mnodeCleanupStep2
()
{
taosStepCleanup
(
tsMint
.
steps2
);
}
static
bool
mnodeNeedDeploy
()
{
static
bool
mnodeNeedDeploy
()
{
if
(
tsMint
.
dnodeId
>
0
)
return
false
;
if
(
tsMint
.
para
.
dnodeId
>
0
)
return
false
;
if
(
tsMint
.
clusterId
>
0
)
return
false
;
if
(
tsMint
.
para
.
clusterId
>
0
)
return
false
;
if
(
strcmp
(
tsFirst
,
tsLocalEp
)
!=
0
)
return
false
;
if
(
strcmp
(
tsFirst
,
tsLocalEp
)
!=
0
)
return
false
;
return
true
;
return
true
;
}
}
...
@@ -156,7 +149,7 @@ int32_t mnodeDeploy() {
...
@@ -156,7 +149,7 @@ int32_t mnodeDeploy() {
tsMint
.
state
=
MN_STATUS_INIT
;
tsMint
.
state
=
MN_STATUS_INIT
;
}
}
if
(
tsMint
.
dnodeId
<=
0
||
tsMint
.
clusterId
<=
0
)
{
if
(
tsMint
.
para
.
dnodeId
<=
0
||
tsMint
.
para
.
clusterId
<=
0
)
{
mError
(
"failed to deploy mnode since cluster not ready"
);
mError
(
"failed to deploy mnode since cluster not ready"
);
return
TSDB_CODE_MND_NOT_READY
;
return
TSDB_CODE_MND_NOT_READY
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录