]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: handle case where rank 0 has no subtrees
authorJohn Spray <john.spray@redhat.com>
Thu, 30 Apr 2015 10:43:21 +0000 (11:43 +0100)
committerJohn Spray <john.spray@redhat.com>
Fri, 1 May 2015 12:00:57 +0000 (13:00 +0100)
Previously we always asked for STOPPING in this case,
but in the case of rank 0 it's definitely an error
condition indicating repair is needed.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDS.cc

index 74a40821be7ea53594d160dc7146a278649be73a..5aea27d9c3140a839191fa14d5438816300e8818 100644 (file)
@@ -2249,8 +2249,15 @@ void MDS::rejoin_done()
 
   // funny case: is our cache empty?  no subtrees?
   if (!mdcache->is_subtrees()) {
-    dout(1) << " empty cache, no subtrees, leaving cluster" << dendl;
-    request_state(MDSMap::STATE_STOPPED);
+    if (whoami == 0) {
+      // The root should always have a subtree!
+      clog->error() << "No subtrees found for root MDS rank!";
+      damaged();
+      assert(mdcache->is_subtrees());
+    } else {
+      dout(1) << " empty cache, no subtrees, leaving cluster" << dendl;
+      request_state(MDSMap::STATE_STOPPED);
+    }
     return;
   }