]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add 'mds rm <gid>' and 'mds rmfailed <id>' commands
authorSage Weil <sage@newdream.net>
Mon, 18 Oct 2010 03:04:32 +0000 (20:04 -0700)
committerSage Weil <sage@newdream.net>
Mon, 18 Oct 2010 03:04:32 +0000 (20:04 -0700)
For cleaning up the mds map when things get weird.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/MDSMonitor.cc

index 642d9f170764fb0b466a0770430a7d20d71a2931..ca47b8553567ccb5b6b48808f1e92ff9428c9864 100644 (file)
@@ -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") {