From e276683d196c725cdd317342f8b8962a83d12bad Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 18 Jan 2011 13:27:10 -0800 Subject: [PATCH] mon: fix 'ceph mds fail ' command We need to remove the mds_info from the map for cmds to take notice. Fixes: #720 Signed-off-by: Sage Weil --- src/mon/MDSMonitor.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index adec992414c4f..996baeb65ea62 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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())); -- 2.39.5