]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: treat cluster as degraded when there is clientreplay MDS
authorYan, Zheng <zheng.z.yan@intel.com>
Tue, 1 Apr 2014 02:10:28 +0000 (10:10 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Wed, 2 Apr 2014 03:03:10 +0000 (11:03 +0800)
This forbids exporting subtrees and fragmenting dirfrags when there
is MDS in clientreplay state. During replaying client requests, the
MDS may need to authpin some remote objects. Exporting subtrees and
fragmenting dirfrags slow down replaying client requests.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/MDSMap.h

index 004a699068dad2c55344c19d359ed23965ad7cf1..8046a7c4b359e9684eb390b692d986b46e65c33c 100644 (file)
@@ -477,12 +477,14 @@ public:
     return in.size() >= max_mds;
   }
   bool is_degraded() const {   // degraded = some recovery in process.  fixes active membership and recovery_set.
-    return 
-      get_num_mds(STATE_REPLAY) + 
-      get_num_mds(STATE_RESOLVE) + 
-      get_num_mds(STATE_RECONNECT) + 
-      get_num_mds(STATE_REJOIN) + 
-      failed.size();
+    if (!failed.empty())
+      return true;
+    for (map<uint64_t,mds_info_t>::const_iterator p = mds_info.begin();
+        p != mds_info.end();
+        ++p)
+      if (p->second.state >= STATE_REPLAY && p->second.state <= STATE_CLIENTREPLAY)
+       return true;
+    return false;
   }
   bool is_any_failed() {
     return failed.size();