if (propose_osdmap)
mon->osdmon()->propose_pending();
}
+
+void MDSMonitor::send_exits()
+{
+ vector<string> 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());
+ }
+ }
+}
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;
}
}
+void Monitor::send_exit_to_all()
+{
+ dout(10) << "send_exit_to_all " << dendl;
+ osdmon()->send_exits();
+ mdsmon()->send_exits();
+ vector<string> 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<string>& com, version_t version)
{
send_latest(m, m->get_epoch());
}
-
// boot --
bool OSDMonitor::preprocess_boot(MOSDBoot *m)
mon->send_reply(m, reply);
m->put();
}
+
+void OSDMonitor::send_exits()
+{
+ vector<string> 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());
+ }
+ }
+}
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)