From: Sage Weil Date: Fri, 1 Oct 2010 22:54:56 +0000 (-0700) Subject: mon: add 'mds fail N' command X-Git-Tag: v0.22~76 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f389afc9a887a0c7a491e33a803ba7fec445cdea;p=ceph.git mon: add 'mds fail N' command Manually mark an mds rank as failed. The daemon should kill itself when it finds out. Note that this doesn't do any sanity checks, so it can also be used to adjust state in an otherwise inconsistent mdsmap due to other bugs (one where, say, an mds in up but has no info, or not up but not in the failed set.) Signed-off-by: Sage Weil --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 7d87bb5ceee01..642d9f170764f 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -597,6 +597,17 @@ bool MDSMonitor::prepare_command(MMonCommand *m) return true; } } + else if (m->cmd[1] == "fail" && m->cmd.size() == 3) { + int w = atoi(m->cmd[2].c_str()); + pending_mdsmap.failed.insert(w); + pending_mdsmap.up.erase(w); + stringstream ss; + ss << "failed mds" << w; + string rs; + getline(ss, rs); + paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version())); + return true; + } else if (m->cmd[1] == "compat" && m->cmd.size() == 4) { uint64_t f = atoll(m->cmd[3].c_str()); if (m->cmd[2] == "rm_compat") {