]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix 'ceph mds fail <N>' command
authorSage Weil <sage@newdream.net>
Tue, 18 Jan 2011 21:27:10 +0000 (13:27 -0800)
committerSage Weil <sage@newdream.net>
Tue, 18 Jan 2011 21:27:10 +0000 (13:27 -0800)
We need to remove the mds_info from the map for cmds to take notice.

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

index adec992414c4f97b906df1ecc4f67872bab3c5b7..996baeb65ea628488b3ef96c47379eb2d15452f6 100644 (file)
@@ -625,8 +625,9 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
     else if (m->cmd[1] == "fail" && m->cmd.size() == 3) {
       int w = atoi(m->cmd[2].c_str());
 
+      uint64_t gid = pending_mdsmap.up[w];
       if (pending_mdsmap.up.count(w) &&
-         pending_mdsmap.mds_info.count(pending_mdsmap.up[w])) {
+         pending_mdsmap.mds_info.count(gid)) {
        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]];
@@ -635,8 +636,11 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
       }
       pending_mdsmap.failed.insert(w);
       pending_mdsmap.up.erase(w);
+      pending_mdsmap.mds_info.erase(gid);
+      last_beacon.erase(gid);
+
       stringstream ss;
-      ss << "failed mds" << w;
+      ss << "failed mds" << w << " gid " << gid;
       string rs;
       getline(ss, rs);
       paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));