]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: dead code removal
authorDan Mick <dan.mick@inktank.com>
Tue, 2 Jul 2013 23:57:47 +0000 (16:57 -0700)
committerDan Mick <dan.mick@inktank.com>
Wed, 3 Jul 2013 00:10:35 +0000 (17:10 -0700)
Remove code for 'mds cluster_fail', 'osd tell', and auth_usage()

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/mon/AuthMonitor.cc
src/mon/AuthMonitor.h
src/mon/MDSMonitor.cc
src/mon/MDSMonitor.h
src/mon/OSDMonitor.cc

index 9901dab7def0113ab0987f198367e1ce01b8c3ce..a1f19ceac1e4dffb19b9201341fb1a2ea922e5f5 100644 (file)
@@ -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) <name> <--in-file=filename>" << std::endl;
-  ss << "              auth (export | get | get-key | print-key) <name>" << 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;
   }
 
index ab52833daec78c85bfee02ff1cd86cb505c88298..aee4224f0db56c385690c71ccd6832a516f75e5e 100644 (file)
@@ -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,
index 757014257d645ca4ed56d3bf3bdf39e438712230..c89709e102a4b9efd6d0784e47ffaee64dcc4e22 100644 (file)
@@ -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<int32_t,uint64_t>::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";
index b6ca84022afaa54eb1daf9ae240180afc07106ae..02690155579c1f736b4357e642bf7e81d108bb7c 100644 (file)
@@ -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);
 
index 986bf3a821b853fd61f39b7eb93092736aad472f..0e4213479a27357f6167ae716ca385e0199c69b8 100644 (file)
@@ -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<string> 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);