Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2702903e
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2702903e
编写于
4月 19, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: report service status
上级
b66718a4
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
7 addition
and
5 deletion
+7
-5
source/dnode/mgmt/interface/src/dmInt.c
source/dnode/mgmt/interface/src/dmInt.c
+2
-2
tools/shell/src/shellMain.c
tools/shell/src/shellMain.c
+5
-3
未找到文件。
source/dnode/mgmt/interface/src/dmInt.c
浏览文件 @
2702903e
...
@@ -157,10 +157,10 @@ static void dmGetServerStatus(SDnode *pDnode, SServerStatusRsp *pStatus) {
...
@@ -157,10 +157,10 @@ static void dmGetServerStatus(SDnode *pDnode, SServerStatusRsp *pStatus) {
pStatus
->
statusCode
=
TSDB_SRV_STATUS_EXTING
;
pStatus
->
statusCode
=
TSDB_SRV_STATUS_EXTING
;
}
else
{
}
else
{
SDnodeData
*
pData
=
&
pDnode
->
data
;
SDnodeData
*
pData
=
&
pDnode
->
data
;
if
(
pData
->
isMnode
&&
pData
->
mndState
!=
TAOS_SYNC_STATE_
FOLLOWER
&&
pData
->
mndState
!
=
TAOS_SYNC_STATE_FOLLOWER
)
{
if
(
pData
->
isMnode
&&
pData
->
mndState
!=
TAOS_SYNC_STATE_
LEADER
&&
pData
->
mndState
=
=
TAOS_SYNC_STATE_FOLLOWER
)
{
pStatus
->
statusCode
=
TSDB_SRV_STATUS_SERVICE_DEGRADED
;
pStatus
->
statusCode
=
TSDB_SRV_STATUS_SERVICE_DEGRADED
;
snprintf
(
pStatus
->
details
,
sizeof
(
pStatus
->
details
),
"mnode sync state is %s"
,
syncStr
(
pData
->
mndState
));
snprintf
(
pStatus
->
details
,
sizeof
(
pStatus
->
details
),
"mnode sync state is %s"
,
syncStr
(
pData
->
mndState
));
}
else
if
(
pData
->
unsyncedVgId
!=
0
&&
pData
->
vndState
!=
TAOS_SYNC_STATE_
FOLLOW
ER
&&
}
else
if
(
pData
->
unsyncedVgId
!=
0
&&
pData
->
vndState
!=
TAOS_SYNC_STATE_
LEAD
ER
&&
pData
->
vndState
!=
TAOS_SYNC_STATE_FOLLOWER
)
{
pData
->
vndState
!=
TAOS_SYNC_STATE_FOLLOWER
)
{
pStatus
->
statusCode
=
TSDB_SRV_STATUS_SERVICE_DEGRADED
;
pStatus
->
statusCode
=
TSDB_SRV_STATUS_SERVICE_DEGRADED
;
snprintf
(
pStatus
->
details
,
sizeof
(
pStatus
->
details
),
"vnode:%d sync state is %s"
,
pData
->
unsyncedVgId
,
snprintf
(
pStatus
->
details
,
sizeof
(
pStatus
->
details
),
"vnode:%d sync state is %s"
,
pData
->
unsyncedVgId
,
...
...
tools/shell/src/shellMain.c
浏览文件 @
2702903e
...
@@ -633,7 +633,7 @@ void shellCheckServerStatus() {
...
@@ -633,7 +633,7 @@ void shellCheckServerStatus() {
printf
(
"2: service ok
\n
"
);
printf
(
"2: service ok
\n
"
);
break
;
break
;
case
TSDB_SRV_STATUS_SERVICE_DEGRADED
:
case
TSDB_SRV_STATUS_SERVICE_DEGRADED
:
printf
(
"3: service degraded
k
\n
"
);
printf
(
"3: service degraded
\n
"
);
break
;
break
;
case
TSDB_SRV_STATUS_EXTING
:
case
TSDB_SRV_STATUS_EXTING
:
printf
(
"4: exiting
\n
"
);
printf
(
"4: exiting
\n
"
);
...
@@ -642,10 +642,12 @@ void shellCheckServerStatus() {
...
@@ -642,10 +642,12 @@ void shellCheckServerStatus() {
if
(
strlen
(
details
)
!=
0
)
{
if
(
strlen
(
details
)
!=
0
)
{
printf
(
"%s
\n\n
"
,
details
);
printf
(
"%s
\n\n
"
,
details
);
}
}
if
(
code
==
TSDB_SRV_STATUS_NETWORK_OK
)
{
if
(
code
==
TSDB_SRV_STATUS_NETWORK_OK
&&
args
.
verbose
)
{
taosMsleep
(
1000
);
taosMsleep
(
1000
);
}
else
{
break
;
}
}
}
while
(
code
==
TSDB_SRV_STATUS_NETWORK_OK
);
}
while
(
1
);
exitShell
();
exitShell
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录