]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add 'mds fail N' command
authorSage Weil <sage@newdream.net>
Fri, 1 Oct 2010 22:54:56 +0000 (15:54 -0700)
committerSage Weil <sage@newdream.net>
Fri, 1 Oct 2010 22:55:03 +0000 (15:55 -0700)
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 <sage@newdream.net>
src/mon/MDSMonitor.cc

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