From befe42267ab8789af808e3f5763c5626a1178403 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Thu, 9 Jun 2011 16:57:52 -0700 Subject: [PATCH] Revert "mon: add all_exit and exit commands" This reverts commit 69092735c4b25c88ded58b17b1c198fafcf5931b. --- src/mon/MDSMonitor.cc | 12 ------------ src/mon/MDSMonitor.h | 2 -- src/mon/Monitor.cc | 21 --------------------- src/mon/Monitor.h | 1 - src/mon/OSDMonitor.cc | 12 +----------- src/mon/OSDMonitor.h | 2 -- 6 files changed, 1 insertion(+), 49 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index f7e38ec5bab31..9733d20830597 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1179,15 +1179,3 @@ void MDSMonitor::do_stop() if (propose_osdmap) mon->osdmon()->propose_pending(); } - -void MDSMonitor::send_exits() -{ - vector cmd; - cmd.push_back("exit"); - cmd.push_back("immediately"); - for (unsigned i = 0; i < mdsmap.get_max_mds(); ++i) { - if (mdsmap.is_active(i)) { - mon->send_command(mdsmap.get_inst(i), cmd, paxos->get_version()); - } - } -} diff --git a/src/mon/MDSMonitor.h b/src/mon/MDSMonitor.h index e2675b8620f06..e976122ee197e 100644 --- a/src/mon/MDSMonitor.h +++ b/src/mon/MDSMonitor.h @@ -93,8 +93,6 @@ class MDSMonitor : public PaxosService { bool preprocess_command(MMonCommand *m); bool prepare_command(MMonCommand *m); - void send_exits(); - // beacons struct beacon_info_t { utime_t stamp; diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 256942846b941..1b917071e16c3 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -329,15 +329,6 @@ void Monitor::handle_command(MMonCommand *m) reply_command(m, 0, "initiating cluster shutdown", 0); return; } - if (m->cmd[0] == "all_exit") { - send_exit_to_all(); - reply_command(m, 0, "exiting", 0); - return; - } - if (m->cmd[0] == "exit") { - reply_command(m, 0, "exiting", 0); - exit(0); - } if (m->cmd[0] == "_injectargs") { dout(0) << "parsing injected options '" << m->cmd[1] << "'" << dendl; @@ -616,18 +607,6 @@ void Monitor::inject_args(const entity_inst_t& inst, string& args) } } -void Monitor::send_exit_to_all() -{ - dout(10) << "send_exit_to_all " << dendl; - osdmon()->send_exits(); - mdsmon()->send_exits(); - vector cmd; - cmd.push_back("exit"); - for (unsigned i = 0; i < monmap->size(); i++) { - send_command(monmap->get_inst(i), cmd, 0); - } -} - void Monitor::send_command(const entity_inst_t& inst, const vector& com, version_t version) { diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index a780e004e0109..f55b44e0080a4 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -220,7 +220,6 @@ public: void tick(); void stop_cluster(); - void send_exit_to_all(); int mkfs(bufferlist& osdmapbl); diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 71ae6da243ea5..8b47782d64b2d 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -520,6 +520,7 @@ void OSDMonitor::_reported_failure(MOSDFailure *m) send_latest(m, m->get_epoch()); } + // boot -- bool OSDMonitor::preprocess_boot(MOSDBoot *m) @@ -2036,14 +2037,3 @@ void OSDMonitor::_pool_op(MPoolOp *m, int replyCode, epoch_t epoch, bufferlist * mon->send_reply(m, reply); m->put(); } - -void OSDMonitor::send_exits() -{ - vector cmd; - cmd.push_back("exit"); - for (int i = 0; i < osdmap.get_max_osd(); ++i) { - if (osdmap.is_up(i)) { - mon->send_command(osdmap.get_inst(i), cmd, paxos->get_version()); - } - } -} diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index 4a41b31827eb4..126b50132cb33 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -178,8 +178,6 @@ private: void check_subs(); void check_sub(Subscription *sub); - void send_exits(); - void add_flag(int flag) { if (!(osdmap.flags & flag)) { if (pending_inc.new_flags < 0) -- 2.39.5