From: Dan Mick Date: Tue, 2 Jul 2013 23:57:47 +0000 (-0700) Subject: mon: dead code removal X-Git-Tag: v0.66~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9942efde77a7d0f0d2be797c3e3f0584665afe8e;p=ceph.git mon: dead code removal Remove code for 'mds cluster_fail', 'osd tell', and auth_usage() Signed-off-by: Dan Mick Reviewed-by: Sage Weil --- diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 9901dab7def0..a1f19ceac1e4 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -525,14 +525,6 @@ done: return true; } -void AuthMonitor::auth_usage(stringstream& ss) -{ - ss << "error: usage:" << std::endl; - ss << " auth (add | del | get-or-create | get-or-create-key | caps) <--in-file=filename>" << std::endl; - ss << " auth (export | get | get-key | print-key) " << std::endl; - ss << " auth list" << std::endl; -} - bool AuthMonitor::preprocess_command(MMonCommand *m) { int r = -1; @@ -622,7 +614,7 @@ bool AuthMonitor::preprocess_command(MMonCommand *m) r = 0; goto done; } else { - auth_usage(ss); + ss << "invalid command"; r = -EINVAL; } diff --git a/src/mon/AuthMonitor.h b/src/mon/AuthMonitor.h index ab52833daec7..aee4224f0db5 100644 --- a/src/mon/AuthMonitor.h +++ b/src/mon/AuthMonitor.h @@ -35,7 +35,6 @@ class KeyRing; #define MIN_GLOBAL_ID 0x1000 class AuthMonitor : public PaxosService { - void auth_usage(stringstream& ss); enum IncType { GLOBAL_ID, AUTH_DATA, diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 757014257d64..c89709e102a4 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -734,43 +734,6 @@ int MDSMonitor::fail_mds(std::ostream &ss, const std::string &arg) return 0; } -int MDSMonitor::cluster_fail(std::ostream &ss) -{ - dout(10) << "cluster_fail" << dendl; - - if (!pending_mdsmap.test_flag(CEPH_MDSMAP_DOWN)) { - ss << "mdsmap must be marked DOWN first ('mds cluster_down')"; - return -EPERM; - } - if (pending_mdsmap.up.size() && !mon->osdmon()->is_writeable()) { - ss << "osdmap not writeable, can't blacklist up mds's"; - return -EAGAIN; - } - - // --- reset the cluster map --- - if (pending_mdsmap.mds_info.size()) { - // blacklist all old mds's - utime_t until = ceph_clock_now(g_ceph_context); - until += g_conf->mds_blacklist_interval; - for (map::iterator p = pending_mdsmap.up.begin(); - p != pending_mdsmap.up.end(); - ++p) { - MDSMap::mds_info_t& info = pending_mdsmap.mds_info[p->second]; - dout(10) << " blacklisting gid " << p->second << " " << info.addr << dendl; - pending_mdsmap.last_failure_osd_epoch = mon->osdmon()->blacklist(info.addr, until); - } - request_proposal(mon->osdmon()); - } - pending_mdsmap.up.clear(); - pending_mdsmap.failed.insert(pending_mdsmap.in.begin(), - pending_mdsmap.in.end()); - pending_mdsmap.in.clear(); - pending_mdsmap.mds_info.clear(); - - ss << "failed all mds cluster members"; - return 0; -} - bool MDSMonitor::prepare_command(MMonCommand *m) { int r = -EINVAL; @@ -906,13 +869,6 @@ bool MDSMonitor::prepare_command(MMonCommand *m) getline(ss, rs); wait_for_finished_proposal(new Monitor::C_Command(mon, m, 0, rs, get_version())); return true; - } else if (prefix == "mds cluster_fail") { - r = cluster_fail(ss); - if (r < 0 && r == -EAGAIN) { - mon->osdmon()->wait_for_writeable(new C_RetryMessage(this,m)); - return false; // don't propose yet; wait for message to be retried - } - } else if (prefix == "mds cluster_down") { if (pending_mdsmap.test_flag(CEPH_MDSMAP_DOWN)) { ss << "mdsmap already marked DOWN"; diff --git a/src/mon/MDSMonitor.h b/src/mon/MDSMonitor.h index b6ca84022afa..02690155579c 100644 --- a/src/mon/MDSMonitor.h +++ b/src/mon/MDSMonitor.h @@ -99,8 +99,6 @@ class MDSMonitor : public PaxosService { int fail_mds(std::ostream &ss, const std::string &arg); void fail_mds_gid(uint64_t gid); - int cluster_fail(std::ostream &ss); - bool preprocess_command(MMonCommand *m); bool prepare_command(MMonCommand *m); diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 986bf3a821b8..0e4213479a27 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2030,31 +2030,6 @@ bool OSDMonitor::preprocess_command(MMonCommand *m) } else if (prefix == "osd getmaxosd") { ds << "max_osd = " << osdmap.get_max_osd() << " in epoch " << osdmap.get_epoch(); rdata.append(ds); - } else if (prefix == "osd tell") { - string whostr; - cmd_getval(g_ceph_context, cmdmap, "who", whostr); - vector argvec; - cmd_getval(g_ceph_context, cmdmap, "args", argvec); - if (whostr == "*") { - for (int i = 0; i < osdmap.get_max_osd(); ++i) - if (osdmap.is_up(i)) - mon->send_command(osdmap.get_inst(i), argvec, get_version()); - ss << "ok"; - } else { - errno = 0; - int who = parse_osd_id(whostr.c_str(), &ss); - if (who < 0) { - r = -EINVAL; - } else { - if (osdmap.is_up(who)) { - mon->send_command(osdmap.get_inst(who), argvec, get_version()); - ss << "ok"; - } else { - ss << "osd." << who << " not up"; - r = -ENOENT; - } - } - } } else if (prefix == "osd find") { int64_t osd; cmd_getval(g_ceph_context, cmdmap, "id", osd);