summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Eduardo Luis <joao.luis@inktank.com>2013-04-19 13:22:33 +0100
committerJoao Eduardo Luis <joao.luis@inktank.com>2013-04-22 15:14:28 +0100
commit9098caf0b4a913fb81b42739c0bde547dd6fc919 (patch)
tree6679abcb0b0fdcb45ebee6eb034cbbc88d9bea43
parentcae2c66038753e57b6bbb155e6a6c44b5b0c8f17 (diff)
downloadceph-9098caf0b4a913fb81b42739c0bde547dd6fc919.tar.gz
mon: [MDS]Monitor: remove 'stop_cluster' and 'do_stop()'
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r--src/mon/MDSMonitor.cc65
-rw-r--r--src/mon/MDSMonitor.h11
-rw-r--r--src/mon/Monitor.cc18
-rw-r--r--src/mon/Monitor.h2
4 files changed, 0 insertions, 96 deletions
diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc
index 547e9b806ef..d40846de7a1 100644
--- a/src/mon/MDSMonitor.cc
+++ b/src/mon/MDSMonitor.cc
@@ -1300,68 +1300,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;
- if (mon->is_leader())
- wait_for_active(new C_Stop(this));
- return;
- }
-
- if (!mon->osdmon()->is_writeable()) {
- dout(0) << __func__ << " osdmon not writeable -- waiting to stop" << dendl;
- mon->osdmon()->wait_for_writeable(new C_Stop(this));
- 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)
- request_proposal(mon->osdmon());
-}
diff --git a/src/mon/MDSMonitor.h b/src/mon/MDSMonitor.h
index 76e6da5e7e2..2be8686e326 100644
--- a/src/mon/MDSMonitor.h
+++ b/src/mon/MDSMonitor.h
@@ -63,16 +63,6 @@ class MDSMonitor : public PaxosService {
}
};
- class C_Stop : public Context {
- MDSMonitor *mm;
- public:
- C_Stop(MDSMonitor *m) : mm(m) { }
- void finish(int r) {
- if (r >= 0)
- mm->do_stop();
- }
- };
-
void create_new_fs(MDSMap &m, int metadata_pool, int data_pool);
@@ -130,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 cc8527ed7f7..f765e7ac093 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 f5512efd775..f96c167bafc 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);
/**