From: Sage Weil Date: Thu, 4 Nov 2010 05:20:25 +0000 (-0700) Subject: mon: blacklist and update last_failure_osd_epoch in all failure paths X-Git-Tag: v0.23~19^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f511286634ad6e1a462ac74bf9f64d06241b4bae;p=ceph.git mon: blacklist and update last_failure_osd_epoch in all failure paths This includes the pure failure in do_stop(), and the explicit admin fail command. Signed-off-by: Sage Weil --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 213fe215183d..cb3777d0d88b 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -599,6 +599,15 @@ bool MDSMonitor::prepare_command(MMonCommand *m) } else if (m->cmd[1] == "fail" && m->cmd.size() == 3) { int w = atoi(m->cmd[2].c_str()); + + if (pending_mdsmap.up.count(w) && + pending_mdsmap.mds_info.count(pending_mdsmap.up[w])) { + utime_t until = g_clock.now(); + until += g_conf.mds_blacklist_interval; + MDSMap::mds_info_t& info = pending_mdsmap.mds_info[pending_mdsmap.up[w]]; + pending_mdsmap.last_failure_osd_epoch = mon->osdmon()->blacklist(info.addr, until); + mon->osdmon()->propose_pending(); + } pending_mdsmap.failed.insert(w); pending_mdsmap.up.erase(w); stringstream ss; @@ -936,6 +945,8 @@ void MDSMonitor::do_stop() dout(7) << "do_stop stopping active mds nodes" << dendl; print_map(mdsmap); + bool propose_osdmap = false; + map::iterator p = pending_mdsmap.mds_info.begin(); while (p != pending_mdsmap.mds_info.end()) { uint64_t gid = p->first; @@ -959,6 +970,12 @@ void MDSMonitor::do_stop() case MDSMap::STATE_REJOIN: case MDSMap::STATE_CLIENTREPLAY: // BUG: hrm, if this is the case, the STOPPING guys won't be able to stop, will they? + { + utime_t until = g_clock.now(); + until += g_conf.mds_blacklist_interval; + pending_mdsmap.last_failure_osd_epoch = mon->osdmon()->blacklist(info.addr, until); + propose_osdmap = true; + } pending_mdsmap.failed.insert(info.rank); pending_mdsmap.up.erase(info.rank); pending_mdsmap.mds_info.erase(gid); @@ -968,4 +985,6 @@ void MDSMonitor::do_stop() } propose_pending(); + if (propose_osdmap) + mon->osdmon()->propose_pending(); }