After Monitor::init_paxos() has loaded all of the PaxosService state,
we should then map creating pgs to osds. This ensures we do so after the
osdmap has been loaded and the pgs actually map somewhere meaningful.
Fixes: #4675
Signed-off-by: Sage Weil <sage@inktank.com>
void pre_auth(MAuth *m);
void tick(); // check state, take actions
-
- void init();
};
{
dout(10) << __func__ << dendl;
paxos->init();
- // init paxos
+
+ // update paxos
for (int i = 0; i < PAXOS_NUM; ++i) {
if (paxos->is_consistent()) {
paxos_service[i]->update_from_paxos();
}
}
+
+ // init services
+ for (int i = 0; i < PAXOS_NUM; ++i) {
+ if (paxos->is_consistent()) {
+ paxos_service[i]->init();
+ }
+ }
}
void Monitor::register_cluster_logger()
update_logger();
}
+void PGMonitor::init()
+{
+ if (mon->osdmon()->osdmap.get_epoch()) {
+ map_pg_creates();
+ }
+}
+
void PGMonitor::handle_osd_timeouts()
{
if (!mon->is_leader())
void create_initial();
void update_from_paxos();
+ void init();
void handle_osd_timeouts();
void create_pending(); // prepare a new pending
// propose pending update to peers
*/
virtual void update_from_paxos() = 0;
+ /**
+ * Init on startup
+ *
+ * This is called on mon startup, after all of the PaxosService instances'
+ * update_from_paxos() methods have been called
+ */
+ virtual void init() {}
+
/**
* Create the pending state.
*