]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: report damaged ranks in health
authorJohn Spray <john.spray@redhat.com>
Sun, 15 Mar 2015 23:46:26 +0000 (23:46 +0000)
committerJohn Spray <john.spray@redhat.com>
Mon, 23 Mar 2015 10:55:08 +0000 (10:55 +0000)
Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDSMap.cc

index bd0b2e49a656d2582518f4f880b4ba9838fde820..429c97b686cfd8eeab02051a6794158debc1a46d 100644 (file)
@@ -321,6 +321,23 @@ void MDSMap::get_health(list<pair<health_status_t,string> >& summary,
     }
   }
 
+  if (!damaged.empty()) {
+    std::ostringstream oss;
+    oss << "mds rank"
+       << ((damaged.size() > 1) ? "s ":" ")
+       << damaged
+       << ((damaged.size() > 1) ? " are":" is")
+       << " damaged";
+    summary.push_back(make_pair(HEALTH_ERR, oss.str()));
+    if (detail) {
+      for (set<mds_rank_t>::const_iterator p = damaged.begin(); p != damaged.end(); ++p) {
+       std::ostringstream oss;
+       oss << "mds." << *p << " is damaged";
+       detail->push_back(make_pair(HEALTH_ERR, oss.str()));
+      }
+    }
+  }
+
   if (is_degraded()) {
     summary.push_back(make_pair(HEALTH_WARN, "mds cluster is degraded"));
     if (detail) {