]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: [MDS]Monitor: remove 'stop_cluster' and 'do_stop()' 222/head
authorJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 22 Apr 2013 22:25:27 +0000 (23:25 +0100)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 22 Apr 2013 23:18:28 +0000 (00:18 +0100)
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/mon/MDSMonitor.cc
src/mon/MDSMonitor.h
src/mon/Monitor.cc
src/mon/Monitor.h

index 1f204c41c817f16ef232171475ef994975d9e2b0..566bf1caa3f72184cdd01640db8c151a20ff1375 100644 (file)
@@ -1306,60 +1306,3 @@ bool MDSMonitor::try_standby_replay(MDSMap::mds_info_t& finfo, MDSMap::mds_info_
   finfo.state = MDSMap::STATE_STANDBY_REPLAY;
   return true;
 }
-
-
-void MDSMonitor::do_stop()
-{
-  // hrm...
-  if (!mon->is_leader() ||
-      !is_active()) {
-    dout(0) << "do_stop can't stop right now, mdsmap not writeable" << dendl;
-    return;
-  }
-
-  dout(7) << "do_stop stopping active mds nodes" << dendl;
-  print_map(mdsmap);
-
-  bool propose_osdmap = false;
-
-  map<uint64_t,MDSMap::mds_info_t>::iterator p = pending_mdsmap.mds_info.begin();
-  while (p != pending_mdsmap.mds_info.end()) {
-    uint64_t gid = p->first;
-    MDSMap::mds_info_t& info = p->second;
-    ++p;
-    switch (info.state) {
-    case MDSMap::STATE_ACTIVE:
-    case MDSMap::STATE_STOPPING:
-      info.state = MDSMap::STATE_STOPPING;
-      break;
-    case MDSMap::STATE_STARTING:
-      pending_mdsmap.stopped.insert(info.rank);
-    case MDSMap::STATE_CREATING:
-      pending_mdsmap.up.erase(info.rank);
-      pending_mdsmap.mds_info.erase(gid);
-      pending_mdsmap.in.erase(info.rank);
-      break;
-    case MDSMap::STATE_REPLAY:
-    case MDSMap::STATE_RESOLVE:
-    case MDSMap::STATE_RECONNECT:
-    case MDSMap::STATE_REJOIN:
-    case MDSMap::STATE_CLIENTREPLAY:
-      // BUG: hrm, if this is the case, the STOPPING guys won't be able to stop, will they?
-      {
-       utime_t until = ceph_clock_now(g_ceph_context);
-       until += g_conf->mds_blacklist_interval;
-       pending_mdsmap.last_failure_osd_epoch = mon->osdmon()->blacklist(info.addr, until);
-       propose_osdmap = true;
-      }
-      pending_mdsmap.failed.insert(info.rank);
-      pending_mdsmap.up.erase(info.rank);
-      pending_mdsmap.mds_info.erase(gid);
-      pending_mdsmap.in.erase(info.rank);
-      break;
-    }
-  }
-
-  propose_pending();
-  if (propose_osdmap)
-    mon->osdmon()->propose_pending();
-}
index 3b1fbf92e2d2832f8d40467b4d3533755de66936..2be8686e326017703b8c32f7a6848e9eca9a51ff 100644 (file)
@@ -63,7 +63,6 @@ class MDSMonitor : public PaxosService {
     }
   };
 
-
   void create_new_fs(MDSMap &m, int metadata_pool, int data_pool);
 
 
@@ -121,7 +120,6 @@ public:
   }
 
   void tick();     // check state, take actions
-  void do_stop();
 
   void dump_info(Formatter *f);
 
index cc8527ed7f7eb007f207567fe0338e90a137006e..f765e7ac0931fb39c2e8b7488b03e1c78e032c1f 100644 (file)
@@ -2440,16 +2440,6 @@ void Monitor::handle_command(MMonCommand *m)
     reply_command(m, 0, rs, rdata, 0);
     return;
   }
-  if (m->cmd[0] == "stop_cluster") {
-    if (!access_all) {
-      r = -EACCES;
-      rs = "access denied";
-      goto out;
-    }
-    stop_cluster();
-    reply_command(m, 0, "initiating cluster shutdown", 0);
-    return;
-  }
 
   if (m->cmd[0] == "injectargs") {
     if (!access_all) {
@@ -2954,14 +2944,6 @@ void Monitor::send_command(const entity_inst_t& inst,
   try_send_message(c, inst);
 }
 
-
-void Monitor::stop_cluster()
-{
-  dout(0) << "stop_cluster -- initiating shutdown" << dendl;
-  mdsmon()->do_stop();
-}
-
-
 bool Monitor::_ms_dispatch(Message *m)
 {
   bool ret = true;
index f5512efd775c47246810175de7f6e2cd443af16e..f96c167bafca55098e2e15068ab2a4e3636f7a2a 100644 (file)
@@ -1411,8 +1411,6 @@ public:
 
   void handle_signal(int sig);
 
-  void stop_cluster();
-
   int mkfs(bufferlist& osdmapbl);
 
   /**