aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinnokentii <innokentii@yandex-team.com>2022-11-25 13:29:14 +0300
committerinnokentii <innokentii@yandex-team.com>2022-11-25 13:29:14 +0300
commit3bbe1c95072d079bdd220041e6bc59982e40c3a3 (patch)
treedc23f0282ee725ce171d7b5b97b48443187ab57b
parentaf0121b6a767c5b91416baff9cce349cc7ada49b (diff)
downloadydb-3bbe1c95072d079bdd220041e6bc59982e40c3a3.tar.gz
Fix pdisk statuses in sentinel introspection
fix pdisk statuses in sentinel introspection
-rw-r--r--ydb/core/cms/sentinel.cpp15
-rw-r--r--ydb/core/cms/sentinel_impl.h2
-rw-r--r--ydb/core/cms/ui/sentinel_state.js21
-rw-r--r--ydb/core/protos/cms.proto1
4 files changed, 33 insertions, 6 deletions
diff --git a/ydb/core/cms/sentinel.cpp b/ydb/core/cms/sentinel.cpp
index a818da004f4..7b7492cbf2e 100644
--- a/ydb/core/cms/sentinel.cpp
+++ b/ydb/core/cms/sentinel.cpp
@@ -1078,10 +1078,15 @@ class TSentinel: public TActorBootstrapped<TSentinel> {
auto filterByStatus = [](const TPDiskInfo& info, NKikimrCms::TGetSentinelStateRequest::EShow filter) {
switch(filter) {
case NKikimrCms::TGetSentinelStateRequest::UNHEALTHY:
- return info.GetState() != NKikimrBlobStorage::TPDiskState::Normal || info.GetStatus() != EPDiskStatus::ACTIVE;
+ return info.GetState() != NKikimrBlobStorage::TPDiskState::Normal
+ || info.ActualStatus != EPDiskStatus::ACTIVE
+ || info.GetStatus() != EPDiskStatus::ACTIVE
+ || info.StatusChangeFailed;
case NKikimrCms::TGetSentinelStateRequest::SUSPICIOUS:
return info.GetState() != NKikimrBlobStorage::TPDiskState::Normal
+ || info.ActualStatus != EPDiskStatus::ACTIVE
|| info.GetStatus() != EPDiskStatus::ACTIVE
+ || info.StatusChangeFailed
|| info.StatusChangerState
|| !info.IsTouched()
|| !info.IsChangingAllowed();
@@ -1126,12 +1131,13 @@ class TSentinel: public TActorBootstrapped<TSentinel> {
entry.MutableInfo()->SetState(info->GetState());
entry.MutableInfo()->SetPrevState(info->GetPrevState());
entry.MutableInfo()->SetStateCounter(info->GetStateCounter());
- entry.MutableInfo()->SetStatus(info->GetStatus());
+ entry.MutableInfo()->SetStatus(info->ActualStatus);
+ entry.MutableInfo()->SetDesiredStatus(info->GetStatus());
entry.MutableInfo()->SetChangingAllowed(info->IsChangingAllowed());
entry.MutableInfo()->SetTouched(info->IsTouched());
entry.MutableInfo()->SetLastStatusChange(info->LastStatusChange.ToString());
+ entry.MutableInfo()->SetStatusChangeFailed(info->StatusChangeFailed);
if (info->StatusChangerState) {
- entry.MutableInfo()->SetDesiredStatus(info->StatusChangerState->Status);
entry.MutableInfo()->SetStatusChangeAttempts(info->StatusChangerState->Attempt);
}
if (info->PrevStatusChangerState) {
@@ -1164,10 +1170,13 @@ class TSentinel: public TActorBootstrapped<TSentinel> {
if (!success) {
LOG_C("PDisk status has NOT been changed"
<< ": pdiskId# " << id);
+ it->second->StatusChangeFailed = true;
(*Counters->PDisksNotChanged)++;
} else {
LOG_N("PDisk status has been changed"
<< ": pdiskId# " << id);
+ it->second->ActualStatus = it->second->GetStatus();
+ it->second->StatusChangeFailed = false;
(*Counters->PDisksChanged)++;
}
diff --git a/ydb/core/cms/sentinel_impl.h b/ydb/core/cms/sentinel_impl.h
index bdb380858b1..55ab90abab4 100644
--- a/ydb/core/cms/sentinel_impl.h
+++ b/ydb/core/cms/sentinel_impl.h
@@ -92,6 +92,8 @@ struct TPDiskInfo
TActorId StatusChanger;
TInstant LastStatusChange;
+ bool StatusChangeFailed = false;
+ EPDiskStatus ActualStatus = EPDiskStatus::ACTIVE;
TStatusChangerState::TPtr StatusChangerState;
TStatusChangerState::TPtr PrevStatusChangerState;
EIgnoreReason IgnoreReason = NKikimrCms::TPDiskInfo::NOT_IGNORED;
diff --git a/ydb/core/cms/ui/sentinel_state.js b/ydb/core/cms/ui/sentinel_state.js
index 9ae740493d4..78942081f8c 100644
--- a/ydb/core/cms/ui/sentinel_state.js
+++ b/ydb/core/cms/ui/sentinel_state.js
@@ -37,13 +37,14 @@ const PDiskHeaders = [
"PrevState",
"StateCounter",
"Status",
+ "DesiredStatus",
"ChangingAllowed",
+ "LastStatusChange",
+ "StatusChangeFailed",
"Touched",
- "DesiredStatus",
"StatusChangeAttempts",
"PrevDesiredStatus",
"PrevStatusChangeAttempts",
- "LastStatusChange",
"IgnoreReason",
];
@@ -150,6 +151,13 @@ class CmsSentinelState {
};
}
+ getHiddenPDiskInfo() {
+ return [
+ "PrevDesiredStatus",
+ "PrevStatusChangeAttempts",
+ ];
+ }
+
nameToSelector(name) {
return (name.charAt(0).toLowerCase() + name.slice(1)).replace(/([A-Z])/g, "-$1").toLowerCase();
}
@@ -368,7 +376,14 @@ class CmsSentinelState {
}
addCheckbox(elem, name) {
- var cb = $('<input />', { type: 'checkbox', id: 'cb-' + name, value: name, checked: 'checked' });
+ var params = { type: 'checkbox', id: 'cb-' + name, value: name };
+ if (!this.getHiddenPDiskInfo().includes(name)) {
+ params.checked = 'checked';
+ } else {
+ this.filtered[name] = true;
+ this.filteredSize++;
+ }
+ var cb = $('<input />', params);
cb.change(function() {
if(cb[0].checked) {
diff --git a/ydb/core/protos/cms.proto b/ydb/core/protos/cms.proto
index 05ae41eac08..3d9a359df78 100644
--- a/ydb/core/protos/cms.proto
+++ b/ydb/core/protos/cms.proto
@@ -627,6 +627,7 @@ message TPDiskInfo {
optional uint32 PrevStatusChangeAttempts = 10;
optional string LastStatusChange = 11;
optional EIgnoreReason IgnoreReason = 12;
+ optional bool StatusChangeFailed = 13;
}
message TPDisk {