]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: handle missing/corrupt data during boot
authorJohn Spray <john.spray@redhat.com>
Thu, 30 Apr 2015 16:44:23 +0000 (17:44 +0100)
committerJohn Spray <john.spray@redhat.com>
Fri, 1 May 2015 12:00:57 +0000 (13:00 +0100)
These errors trickle up to boot_start from e.g.
CInode::_fetched when something goes wrong.

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

index 5aea27d9c3140a839191fa14d5438816300e8818..be3d39bc19fe6b3bf0a85c42eeddec509e1cc97f 100644 (file)
@@ -1939,7 +1939,14 @@ void MDS::boot_start(BootStep step, int r)
       dout(0) << "boot_start encountered an error EAGAIN"
               << ", respawning since we fell behind journal" << dendl;
       respawn();
+    } else if (r == -EINVAL || r == -ENOENT) {
+      // Invalid or absent data, indicates damaged on-disk structures
+      clog->error() << "Error loading MDS rank " << whoami << ": "
+        << cpp_strerror(r);
+      damaged();
+      assert(r == 0);  // Unreachable, damaged() calls respawn()
     } else {
+      // Completely unexpected error, give up and die
       dout(0) << "boot_start encountered an error, failing" << dendl;
       suicide();
       return;