]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: Cope with failures during creation
authorJohn Spray <john.spray@inktank.com>
Fri, 21 Feb 2014 16:18:13 +0000 (16:18 +0000)
committerJohn Spray <john.spray@inktank.com>
Fri, 21 Feb 2014 16:22:56 +0000 (16:22 +0000)
Previously an MDS which failed in state CREATING could be
assigned the sequence BOOT->STANDBY->REPLAY at its next
startup, which fails to re-try the creation.

Fixes: #7485
Signed-off-by: John Spray <john.spray@inktank.com>
src/mon/MDSMonitor.cc

index 1e81eba9ad802b4c7734e1a6b1f6964a612b3cd6..d1b2dcc841f937dade0f1e3cdf0cf591551d5558 100644 (file)
@@ -721,8 +721,17 @@ void MDSMonitor::fail_mds_gid(uint64_t gid)
   pending_mdsmap.last_failure_osd_epoch = mon->osdmon()->blacklist(info.addr, until);
 
   if (info.rank >= 0) {
+    if (info.state == MDSMap::STATE_CREATING) {
+      // If this gid didn't make it past CREATING, then forget
+      // the rank ever existed so that next time it's handed out
+      // to a gid it'll go back into CREATING.
+      pending_mdsmap.in.erase(info.rank);
+    } else {
+      // Put this rank into the failed list so that the next available STANDBY will
+      // pick it up.
+      pending_mdsmap.failed.insert(info.rank);
+    }
     pending_mdsmap.up.erase(info.rank);
-    pending_mdsmap.failed.insert(info.rank);
   }
 
   pending_mdsmap.mds_info.erase(gid);