From b73ef010bf22059c0ca07086208422542d4093cf Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Mon, 22 Apr 2013 23:25:27 +0100 Subject: [PATCH] mon: [MDS]Monitor: remove 'stop_cluster' and 'do_stop()' Signed-off-by: Joao Eduardo Luis --- src/mon/MDSMonitor.cc | 57 ------------------------------------------- src/mon/MDSMonitor.h | 2 -- src/mon/Monitor.cc | 18 -------------- src/mon/Monitor.h | 2 -- 4 files changed, 79 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 1f204c41c817..566bf1caa3f7 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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::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(); -} diff --git a/src/mon/MDSMonitor.h b/src/mon/MDSMonitor.h index 3b1fbf92e2d2..2be8686e3260 100644 --- a/src/mon/MDSMonitor.h +++ b/src/mon/MDSMonitor.h @@ -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); diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index cc8527ed7f7e..f765e7ac0931 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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; diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index f5512efd775c..f96c167bafca 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -1411,8 +1411,6 @@ public: void handle_signal(int sig); - void stop_cluster(); - int mkfs(bufferlist& osdmapbl); /** -- 2.47.3