From: Sage Weil Date: Mon, 18 Oct 2010 03:04:32 +0000 (-0700) Subject: mon: add 'mds rm ' and 'mds rmfailed ' commands X-Git-Tag: v0.22.1~28 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=69b764a8d30587c4f800d0ec5942a1978f702ba7;p=ceph.git mon: add 'mds rm ' and 'mds rmfailed ' commands For cleaning up the mds map when things get weird. Signed-off-by: Sage Weil --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 642d9f170764f..ca47b8553567c 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -608,6 +608,26 @@ bool MDSMonitor::prepare_command(MMonCommand *m) paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version())); return true; } + else if (m->cmd[1] == "rm" && m->cmd.size() == 3) { + uint64_t gid = atoll(m->cmd[2].c_str()); + pending_mdsmap.mds_info.erase(gid); + stringstream ss; + ss << "removed mds gid " << gid; + 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] == "rmfailed" && m->cmd.size() == 3) { + int w = atoi(m->cmd[2].c_str()); + pending_mdsmap.failed.erase(w); + stringstream ss; + ss << "removed 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") {