From: John Spray Date: Fri, 21 Feb 2014 16:18:13 +0000 (+0000) Subject: mon/MDSMonitor: Cope with failures during creation X-Git-Tag: v0.79~190^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ebb1f83db34f7dbf9e4c8203d7723f3a7532ed3;p=ceph.git mon/MDSMonitor: Cope with failures during creation 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 --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 1e81eba9ad80..d1b2dcc841f9 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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);