]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: PGs can be stuck more than one thing 11660/head
authorSage Weil <sage@redhat.com>
Wed, 5 Oct 2016 19:32:34 +0000 (15:32 -0400)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Wed, 26 Oct 2016 09:44:22 +0000 (15:14 +0530)
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>
(cherry picked from commit cab233d582ebb31e3ceb7d0abdd22c8fb34df831)

src/mon/PGMap.cc

index fbef9bab0c4b5980e29cd554f6b3e3010fa7a4e6..861c8049274ffd9be6443ff3e53aaf3500697a09 100644 (file)
@@ -964,20 +964,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;
     }