Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f4e648b7
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看板
提交
f4e648b7
编写于
11月 02, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
cb539ad5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
28 deletion
+32
-28
include/common/taosmsg.h
include/common/taosmsg.h
+1
-2
source/dnode/mgmt/inc/dnodeInt.h
source/dnode/mgmt/inc/dnodeInt.h
+1
-1
source/dnode/mgmt/src/dnodeDnode.c
source/dnode/mgmt/src/dnodeDnode.c
+10
-5
source/dnode/mgmt/src/dnodeInt.c
source/dnode/mgmt/src/dnodeInt.c
+15
-15
src/kit/shell/src/tnettest.c
src/kit/shell/src/tnettest.c
+5
-5
未找到文件。
include/common/taosmsg.h
浏览文件 @
f4e648b7
...
@@ -925,8 +925,7 @@ typedef struct {
...
@@ -925,8 +925,7 @@ typedef struct {
int8_t
reserved1
[
7
];
int8_t
reserved1
[
7
];
char
name
[
TSDB_STEP_NAME_LEN
];
char
name
[
TSDB_STEP_NAME_LEN
];
char
desc
[
TSDB_STEP_DESC_LEN
];
char
desc
[
TSDB_STEP_DESC_LEN
];
char
reserved2
[
64
];
}
SStartupMsg
;
}
SStartupStep
;
// mq related
// mq related
typedef
struct
{
typedef
struct
{
...
...
source/dnode/mgmt/inc/dnodeInt.h
浏览文件 @
f4e648b7
...
@@ -42,7 +42,7 @@ void dnodeCleanup();
...
@@ -42,7 +42,7 @@ void dnodeCleanup();
EDnStat
dnodeGetRunStat
();
EDnStat
dnodeGetRunStat
();
void
dnodeSetRunStat
();
void
dnodeSetRunStat
();
void
dnodeGetStartup
(
SStartup
Step
*
);
void
dnodeGetStartup
(
SStartup
Msg
*
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/dnode/mgmt/src/dnodeDnode.c
浏览文件 @
f4e648b7
...
@@ -448,21 +448,26 @@ static void dnodeProcessConfigDnodeReq(SRpcMsg *pMsg) {
...
@@ -448,21 +448,26 @@ static void dnodeProcessConfigDnodeReq(SRpcMsg *pMsg) {
static
void
dnodeProcessStartupReq
(
SRpcMsg
*
pMsg
)
{
static
void
dnodeProcessStartupReq
(
SRpcMsg
*
pMsg
)
{
dInfo
(
"startup msg is received, cont:%s"
,
(
char
*
)
pMsg
->
pCont
);
dInfo
(
"startup msg is received, cont:%s"
,
(
char
*
)
pMsg
->
pCont
);
SStartup
Step
*
pStep
=
rpcMallocCont
(
sizeof
(
SStartupStep
));
SStartup
Msg
*
pStartup
=
rpcMallocCont
(
sizeof
(
SStartupMsg
));
dnodeGetStartup
(
pSt
e
p
);
dnodeGetStartup
(
pSt
artu
p
);
dInfo
(
"startup msg is sent, step:%s desc:%s finished:%d"
,
pSt
ep
->
name
,
pStep
->
desc
,
pSte
p
->
finished
);
dInfo
(
"startup msg is sent, step:%s desc:%s finished:%d"
,
pSt
artup
->
name
,
pStartup
->
desc
,
pStartu
p
->
finished
);
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
pCont
=
pSt
ep
,
.
contLen
=
sizeof
(
SStartupStep
)};
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
pCont
=
pSt
artup
,
.
contLen
=
sizeof
(
SStartupMsg
)};
rpcSendResponse
(
&
rpcRsp
);
rpcSendResponse
(
&
rpcRsp
);
rpcFreeCont
(
pMsg
->
pCont
);
rpcFreeCont
(
pMsg
->
pCont
);
}
}
static
void
*
dnodeThreadRoutine
(
void
*
param
)
{
static
void
*
dnodeThreadRoutine
(
void
*
param
)
{
int32_t
ms
=
tsStatusInterval
*
1000
;
int32_t
ms
=
tsStatusInterval
*
1000
;
while
(
!
tsDnode
.
threadStop
)
{
while
(
!
tsDnode
.
threadStop
)
{
if
(
dnodeGetRunStat
()
!=
DN_RUN_STAT_RUNNING
)
{
continue
;
}
else
{
dnodeSendStatusMsg
();
}
taosMsleep
(
ms
);
taosMsleep
(
ms
);
dnodeSendStatusMsg
();
}
}
}
}
...
...
source/dnode/mgmt/src/dnodeInt.c
浏览文件 @
f4e648b7
...
@@ -26,30 +26,30 @@
...
@@ -26,30 +26,30 @@
#include "wal.h"
#include "wal.h"
static
struct
{
static
struct
{
EDnStat
runStatus
;
SStartupMsg
startup
;
SStartupStep
startup
;
EDnStat
runStat
;
SSteps
*
steps
;
SSteps
*
steps
;
}
tsInt
;
}
tsInt
;
EDnStat
dnodeGetRunStat
()
{
return
tsInt
.
runStat
us
;
}
EDnStat
dnodeGetRunStat
()
{
return
tsInt
.
runStat
;
}
void
dnodeSetRunStat
(
EDnStat
stat
)
{
tsInt
.
runStat
us
=
stat
;
}
void
dnodeSetRunStat
(
EDnStat
stat
)
{
tsInt
.
runStat
=
stat
;
}
static
void
dnodeReportStartup
(
char
*
name
,
char
*
desc
)
{
static
void
dnodeReportStartup
(
char
*
name
,
char
*
desc
)
{
SStartup
Step
*
s
tartup
=
&
tsInt
.
startup
;
SStartup
Msg
*
pS
tartup
=
&
tsInt
.
startup
;
tstrncpy
(
startup
->
name
,
name
,
strlen
(
s
tartup
->
name
));
tstrncpy
(
pStartup
->
name
,
name
,
strlen
(
pS
tartup
->
name
));
tstrncpy
(
startup
->
desc
,
desc
,
strlen
(
s
tartup
->
desc
));
tstrncpy
(
pStartup
->
desc
,
desc
,
strlen
(
pS
tartup
->
desc
));
s
tartup
->
finished
=
0
;
pS
tartup
->
finished
=
0
;
}
}
static
void
dnodeReportStartupFinished
(
char
*
name
,
char
*
desc
)
{
static
void
dnodeReportStartupFinished
(
char
*
name
,
char
*
desc
)
{
SStartup
Step
*
s
tartup
=
&
tsInt
.
startup
;
SStartup
Msg
*
pS
tartup
=
&
tsInt
.
startup
;
tstrncpy
(
startup
->
name
,
name
,
strlen
(
s
tartup
->
name
));
tstrncpy
(
pStartup
->
name
,
name
,
strlen
(
pS
tartup
->
name
));
tstrncpy
(
startup
->
desc
,
desc
,
strlen
(
s
tartup
->
desc
));
tstrncpy
(
pStartup
->
desc
,
desc
,
strlen
(
pS
tartup
->
desc
));
s
tartup
->
finished
=
1
;
pS
tartup
->
finished
=
1
;
}
}
void
dnodeGetStartup
(
SStartup
Step
*
pStep
)
{
memcpy
(
pStep
,
&
tsInt
.
startup
,
sizeof
(
SStartupStep
));
}
void
dnodeGetStartup
(
SStartup
Msg
*
pStartup
)
{
memcpy
(
pStartup
,
&
tsInt
.
startup
,
sizeof
(
SStartupMsg
));
}
static
int32_t
dnodeCheckRunning
(
char
*
dir
)
{
static
int32_t
dnodeCheckRunning
(
char
*
dir
)
{
char
filepath
[
256
]
=
{
0
};
char
filepath
[
256
]
=
{
0
};
...
@@ -99,7 +99,7 @@ static int32_t dnodeInitDir() {
...
@@ -99,7 +99,7 @@ static int32_t dnodeInitDir() {
}
}
static
int32_t
dnodeInitMain
()
{
static
int32_t
dnodeInitMain
()
{
tsInt
.
runStat
us
=
DN_RUN_STAT_STOPPED
;
tsInt
.
runStat
=
DN_RUN_STAT_STOPPED
;
tscEmbedded
=
1
;
tscEmbedded
=
1
;
taosIgnSIGPIPE
();
taosIgnSIGPIPE
();
taosBlockSIGPIPE
();
taosBlockSIGPIPE
();
...
...
src/kit/shell/src/tnettest.c
浏览文件 @
f4e648b7
...
@@ -338,7 +338,7 @@ void *taosNetInitRpc(char *secretEncrypt, char spi) {
...
@@ -338,7 +338,7 @@ void *taosNetInitRpc(char *secretEncrypt, char spi) {
return
pRpcConn
;
return
pRpcConn
;
}
}
static
int32_t
taosNetCheckRpc
(
const
char
*
serverFqdn
,
uint16_t
port
,
uint16_t
pktLen
,
char
spi
,
SStartup
Step
*
pStep
)
{
static
int32_t
taosNetCheckRpc
(
const
char
*
serverFqdn
,
uint16_t
port
,
uint16_t
pktLen
,
char
spi
,
SStartup
Msg
*
pStep
)
{
SRpcEpSet
epSet
;
SRpcEpSet
epSet
;
SRpcMsg
reqMsg
;
SRpcMsg
reqMsg
;
SRpcMsg
rspMsg
;
SRpcMsg
rspMsg
;
...
@@ -374,7 +374,7 @@ static int32_t taosNetCheckRpc(const char* serverFqdn, uint16_t port, uint16_t p
...
@@ -374,7 +374,7 @@ static int32_t taosNetCheckRpc(const char* serverFqdn, uint16_t port, uint16_t p
}
}
int32_t
code
=
0
;
int32_t
code
=
0
;
if
(
pStep
!=
NULL
&&
rspMsg
.
pCont
!=
NULL
&&
rspMsg
.
contLen
>
0
&&
rspMsg
.
contLen
<=
sizeof
(
SStartup
Step
))
{
if
(
pStep
!=
NULL
&&
rspMsg
.
pCont
!=
NULL
&&
rspMsg
.
contLen
>
0
&&
rspMsg
.
contLen
<=
sizeof
(
SStartup
Msg
))
{
memcpy
(
pStep
,
rspMsg
.
pCont
,
rspMsg
.
contLen
);
memcpy
(
pStep
,
rspMsg
.
pCont
,
rspMsg
.
contLen
);
code
=
1
;
code
=
1
;
}
}
...
@@ -384,8 +384,8 @@ static int32_t taosNetCheckRpc(const char* serverFqdn, uint16_t port, uint16_t p
...
@@ -384,8 +384,8 @@ static int32_t taosNetCheckRpc(const char* serverFqdn, uint16_t port, uint16_t p
return
code
;
return
code
;
}
}
static
int32_t
taosNetParseStartup
(
SStartup
Step
*
pCont
)
{
static
int32_t
taosNetParseStartup
(
SStartup
Msg
*
pCont
)
{
SStartup
Step
*
pStep
=
pCont
;
SStartup
Msg
*
pStep
=
pCont
;
uInfo
(
"step:%s desc:%s"
,
pStep
->
name
,
pStep
->
desc
);
uInfo
(
"step:%s desc:%s"
,
pStep
->
name
,
pStep
->
desc
);
if
(
pStep
->
finished
)
{
if
(
pStep
->
finished
)
{
...
@@ -398,7 +398,7 @@ static int32_t taosNetParseStartup(SStartupStep *pCont) {
...
@@ -398,7 +398,7 @@ static int32_t taosNetParseStartup(SStartupStep *pCont) {
static
void
taosNetTestStartup
(
char
*
host
,
int32_t
port
)
{
static
void
taosNetTestStartup
(
char
*
host
,
int32_t
port
)
{
uInfo
(
"check startup, host:%s port:%d
\n
"
,
host
,
port
);
uInfo
(
"check startup, host:%s port:%d
\n
"
,
host
,
port
);
SStartup
Step
*
pStep
=
malloc
(
sizeof
(
SStartupStep
));
SStartup
Msg
*
pStep
=
malloc
(
sizeof
(
SStartupMsg
));
while
(
1
)
{
while
(
1
)
{
int32_t
code
=
taosNetCheckRpc
(
host
,
port
+
TSDB_PORT_DNODEDNODE
,
20
,
0
,
pStep
);
int32_t
code
=
taosNetCheckRpc
(
host
,
port
+
TSDB_PORT_DNODEDNODE
,
20
,
0
,
pStep
);
if
(
code
>
0
)
{
if
(
code
>
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录