- rename: importing inode... also journal imported client map?
mon
+- how to tell osd to cleanly shut down
- mds injectargs N should take mds# or id. * should bcast to standy mds's.
- paxos need to clean up old states.
- default: simple max of (state count, min age), so that we have at least N hours of history, say?
void MDSMonitor::committed()
{
// hackish: did all mds's shut down?
+ /*
if (mon->is_leader() &&
g_conf.mon_stop_with_last_mds &&
mdsmap.get_epoch() > 1 &&
mdsmap.is_stopped())
mon->messenger->send_message(new MGenericMessage(CEPH_MSG_SHUTDOWN),
mon->monmap->get_inst(mon->whoami));
-
+ */
tick();
}
handle_mon_get_map((MMonGetMap*)m);
break;
- case CEPH_MSG_SHUTDOWN:
- handle_shutdown(m);
- break;
-
case MSG_MON_COMMAND:
handle_command((MMonCommand*)m);
break;
}
-void Monitor::handle_shutdown(Message *m)
-{
- assert(m->get_source().is_mon());
- if (m->get_source().num() == get_leader()) {
- dout(1) << "shutdown from leader " << m->get_source() << dendl;
-
- if (is_leader()) {
- // stop osds.
- set<int32_t> ls;
- osdmon()->osdmap.get_all_osds(ls);
- for (set<int32_t>::iterator it = ls.begin(); it != ls.end(); it++) {
- if (osdmon()->osdmap.is_down(*it)) continue;
- dout(10) << "sending shutdown to osd" << *it << dendl;
- messenger->send_message(new PaxosServiceMessage(CEPH_MSG_SHUTDOWN, 0),
- osdmon()->osdmap.get_inst(*it));
- }
- osdmon()->mark_all_down();
-
- // monitors too.
- for (unsigned i=0; i<monmap->size(); i++)
- if ((int)i != whoami)
- messenger->send_message(new PaxosServiceMessage(CEPH_MSG_SHUTDOWN, 0),
- monmap->get_inst(i));
- }
-
- shutdown();
- } else {
- dout(1) << "ignoring shutdown from non-leader " << m->get_source() << dendl;
- }
- delete m;
-}
// messages
void handle_subscribe(MMonSubscribe *m);
void handle_mon_get_map(MMonGetMap *m);
- void handle_shutdown(Message *m);
void handle_command(class MMonCommand *m);
void handle_observe(MMonObserve *m);
void handle_class(MClass *m);