]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: PGs can be stuck more than one thing 11339/head
authorSage Weil <sage@redhat.com>
Wed, 5 Oct 2016 19:32:34 +0000 (15:32 -0400)
committerSage Weil <sage@redhat.com>
Wed, 5 Oct 2016 19:32:34 +0000 (15:32 -0400)
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 <sage@redhat.com>
src/mon/PGMap.cc

index 37099cb0008169e0cb666956add05ef45d07016c..cd59129dec1944eb587280b8da161cbb712e2893 100644 (file)
@@ -1046,20 +1046,23 @@ bool PGMap::get_stuck_counts(const utime_t cutoff, map<string, int>& note) const
   for (ceph::unordered_map<pg_t, pg_stat_t>::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;
     }