]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/PGMap: some stuck warnings are err, some warn
authorSage Weil <sage@redhat.com>
Thu, 29 Jun 2017 16:38:49 +0000 (12:38 -0400)
committerSage Weil <sage@redhat.com>
Wed, 12 Jul 2017 16:52:02 +0000 (12:52 -0400)
inactive and stale -> error
degraded, unclean, undersized -> warning

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/PGMap.cc

index dbd1b5812111b57db91e379d1c80ee8285a6222e..50a1951fab9d808a114742355b0b84f8f9426930 100644 (file)
@@ -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, &degraded->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);