]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: health metric for being read only
authorJohn Spray <john.spray@redhat.com>
Wed, 6 Apr 2016 11:04:30 +0000 (12:04 +0100)
committerJohn Spray <john.spray@redhat.com>
Wed, 6 Apr 2016 12:05:16 +0000 (13:05 +0100)
This is the state we get after an OSD write
error, so it's definitely something we want
to tell the user about in ceph status.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/Beacon.cc
src/messages/MMDSBeacon.h

index 16f20badc749af2a72531e4618ad74a091348ef0..9a07b915974f4cc0685261468948e3b2d09c2121 100644 (file)
@@ -443,6 +443,13 @@ void Beacon::notify_health(MDSRank const *mds)
       large_completed_requests_metrics.clear();
     }
   }
+
+  // Report a health warning if we are readonly
+  if (mds->mdcache->is_readonly()) {
+    MDSHealthMetric m(MDS_HEALTH_READ_ONLY, HEALTH_WARN,
+                      "MDS in read-only mode");
+    health.metrics.push_back(m);
+  }
 }
 
 MDSMap::DaemonState Beacon::get_want_state() const
index a15507560a655956bfd3c2f661896124703f5060..727aaad71474e7675b970f0756be3bba65837902 100644 (file)
@@ -37,7 +37,8 @@ enum mds_metric_t {
   MDS_HEALTH_CLIENT_LATE_RELEASE_MANY,
   MDS_HEALTH_CLIENT_OLDEST_TID,
   MDS_HEALTH_CLIENT_OLDEST_TID_MANY,
-  MDS_HEALTH_DAMAGE
+  MDS_HEALTH_DAMAGE,
+  MDS_HEALTH_READ_ONLY
 };
 
 /**