aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Efimov <xeno@prnwatch.com>2022-08-17 12:45:29 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2022-08-17 12:45:29 +0300
commit8378a635da3f01abe9b2259130dad2765771e459 (patch)
tree40b01877128216d7e02565a46e1a6f9b488b0bd4
parent3840f188bdd744d71a0122e01ebb6b60cb720c9c (diff)
downloadydb-8378a635da3f01abe9b2259130dad2765771e459.tar.gz
return yellow issue for dead followers KIKIMR-15534
REVIEW: 2843024 x-ydb-stable-ref: b04257160e0355fedf38d4f9671ae5ebc49ca29d
-rw-r--r--ydb/core/health_check/health_check.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/ydb/core/health_check/health_check.cpp b/ydb/core/health_check/health_check.cpp
index 7c8debb934..35222b82c1 100644
--- a/ydb/core/health_check/health_check.cpp
+++ b/ydb/core/health_check/health_check.cpp
@@ -111,11 +111,13 @@ public:
struct TNodeTabletStateCount {
NKikimrTabletBase::TTabletTypes::EType Type;
ETabletState State;
+ bool Leader;
int Count = 1;
TStackVec<TString> Identifiers;
TNodeTabletStateCount(const NKikimrHive::TTabletInfo& info, const TTabletStateSettings& settings) {
Type = info.tablettype();
+ Leader = info.followerid() == 0;
if (info.volatilestate() == NKikimrHive::TABLET_VOLATILE_STATE_STOPPED) {
State = ETabletState::Stopped;
} else if (info.volatilestate() != NKikimrHive::TABLET_VOLATILE_STATE_RUNNING
@@ -130,7 +132,7 @@ public:
}
bool operator ==(const TNodeTabletStateCount& o) const {
- return State == o.State && Type == o.Type;
+ return State == o.State && Type == o.Type && Leader == o.Leader;
}
};
@@ -1334,7 +1336,11 @@ public:
break;
case TNodeTabletState::ETabletState::Dead:
computeTabletStatus.set_state("DEAD");
- tabletContext.ReportStatus(Ydb::Monitoring::StatusFlag::RED, "Tablets are dead", "tablet-state");
+ if (count.Leader) {
+ tabletContext.ReportStatus(Ydb::Monitoring::StatusFlag::RED, "Tablets are dead", "tablet-state");
+ } else {
+ tabletContext.ReportStatus(Ydb::Monitoring::StatusFlag::YELLOW, "Followers are dead", "tablet-state");
+ }
break;
}
computeTabletStatus.set_overall(tabletContext.GetOverallStatus());