From: Sage Weil Date: Wed, 5 Oct 2016 19:32:34 +0000 (-0400) Subject: mon/PGMap: PGs can be stuck more than one thing X-Git-Tag: v11.1.0~634^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cab233d582ebb31e3ceb7d0abdd22c8fb34df831;p=ceph.git mon/PGMap: PGs can be stuck more than one thing This was inadvertantly changed waaay back in 9c95bb0454dbad781b6655f4c7116620005101f7. This fixes the health warnings so that they are complete and (most importantly) consistent with the results of 'pg dump_stuck ...'. Fixes: http://tracker.ceph.com/issues/17515 Signed-off-by: Sage Weil --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 37099cb00081..cd59129dec19 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -1046,20 +1046,23 @@ bool PGMap::get_stuck_counts(const utime_t cutoff, map& note) const for (ceph::unordered_map::const_iterator i = pg_stat.begin(); i != pg_stat.end(); ++i) { - if (! (i->second.state & PG_STATE_ACTIVE)) { if (i->second.last_active < cutoff) ++inactive; - } else if (! (i->second.state & PG_STATE_CLEAN)) { + } + if (! (i->second.state & PG_STATE_CLEAN)) { if (i->second.last_clean < cutoff) ++unclean; - } else if (i->second.state & PG_STATE_DEGRADED) { + } + if (i->second.state & PG_STATE_DEGRADED) { if (i->second.last_undegraded < cutoff) ++degraded; - } else if (i->second.state & PG_STATE_UNDERSIZED) { + } + if (i->second.state & PG_STATE_UNDERSIZED) { if (i->second.last_fullsized < cutoff) ++undersized; - } else if (i->second.state & PG_STATE_STALE) { + } + if (i->second.state & PG_STATE_STALE) { if (i->second.last_unstale < cutoff) ++stale; }