From 3b01be0d4b261078db70dfb02c0f63c4479adf48 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 29 Jun 2017 12:38:49 -0400 Subject: [PATCH] mon/PGMap: some stuck warnings are err, some warn inactive and stale -> error degraded, unclean, undersized -> warning Signed-off-by: Sage Weil --- src/mon/PGMap.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index dbd1b581211..50a1951fab9 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -2702,10 +2702,19 @@ void PGMap::get_health_checks( now, max, &inactive->detail); ++num_inactive; } + if ((i.second.state & PG_STATE_STALE) && + i.second.last_unstale < cutoff) { + if (!stale) { + stale = &checks->add("PG_STUCK_STALE", HEALTH_ERR, ""); + } + note_stuck_detail(i.first, i.second, "stale", i.second.last_unstale, + now, max, &stale->detail); + ++num_stale; + } if (!(i.second.state & PG_STATE_CLEAN) && i.second.last_clean < cutoff) { if (!unclean) { - unclean = &checks->add("PG_STUCK_UNCLEAN", HEALTH_ERR, ""); + unclean = &checks->add("PG_STUCK_UNCLEAN", HEALTH_WARN, ""); } note_stuck_detail(i.first, i.second, "unclean", i.second.last_clean, now, max, &unclean->detail); @@ -2714,7 +2723,7 @@ void PGMap::get_health_checks( if ((i.second.state & PG_STATE_DEGRADED) && i.second.last_undegraded < cutoff) { if (!degraded) { - degraded = &checks->add("PG_STUCK_DEGRADED", HEALTH_ERR, ""); + degraded = &checks->add("PG_STUCK_DEGRADED", HEALTH_WARN, ""); } note_stuck_detail(i.first, i.second, "degraded", i.second.last_undegraded, now, max, °raded->detail); @@ -2723,22 +2732,13 @@ void PGMap::get_health_checks( if ((i.second.state & PG_STATE_UNDERSIZED) && i.second.last_fullsized < cutoff) { if (!undersized) { - undersized = &checks->add("PG_STUCK_UNDERSIZED", HEALTH_ERR, ""); + undersized = &checks->add("PG_STUCK_UNDERSIZED", HEALTH_WARN, ""); } note_stuck_detail(i.first, i.second, "undersized", i.second.last_fullsized, now, max, &undersized->detail); ++num_undersized; } - if ((i.second.state & PG_STATE_STALE) && - i.second.last_unstale < cutoff) { - if (!stale) { - stale = &checks->add("PG_STUCK_STALE", HEALTH_ERR, ""); - } - note_stuck_detail(i.first, i.second, "stale", i.second.last_unstale, - now, max, &stale->detail); - ++num_stale; - } } if (inactive) { note_stuck_summary("inactive", num_inactive, max, inactive); -- 2.39.5