}
// load up pgs (as they previously existed)
- // defer querying until after the messenger is initialized
- map<int, map<pg_t, PG::Query> > query_map;
- load_pgs(query_map);
+ load_pgs();
dout(2) << "superblock: i am osd" << superblock.whoami << dendl;
assert_warn(whoami == superblock.whoami);
dout(0) << "started rotating keys" << dendl;
#endif
- do_queries(query_map);
-
return 0;
}
}
-void OSD::load_pgs(map<int, map<pg_t, PG::Query> > &query_map)
+void OSD::load_pgs()
{
assert(osd_lock.is_locked());
dout(10) << "load_pgs" << dendl;
int role = osdmap->calc_pg_role(whoami, pg->acting, nrep);
pg->set_role(role);
- PG::RecoveryCtx rctx(&query_map, 0, 0, 0, 0);
- pg->handle_create(&rctx);
+ PG::RecoveryCtx rctx(0, 0, 0, 0, 0);
+ pg->handle_loaded(&rctx);
dout(10) << "load_pgs loaded " << *pg << " " << pg->log << dendl;
pg->unlock();
ObjectStore::Transaction **pt,
C_Contexts **pfin);
- void load_pgs(map<int, map<pg_t, PG::Query> > &query_map);
+ void load_pgs();
void calc_priors_during(pg_t pgid, epoch_t start, epoch_t end, set<int>& pset);
void project_pg_history(pg_t pgid, PG::Info::History& h, epoch_t from,
vector<int>& lastup, vector<int>& lastacting);
end_handle();
}
+void PG::RecoveryState::handle_loaded(RecoveryCtx *rctx)
+{
+ start_handle(rctx);
+ machine.process_event(Load());
+ end_handle();
+}
+
void PG::RecoveryState::handle_create(RecoveryCtx *rctx)
{
start_handle(rctx);
machine.process_event(Initialize());
end_handle();
}
+
/*---------------------------------------------------*/
#undef dout_prefix
#define dout_prefix (*_dout << pg->gen_prefix() << "PgPriorSet: ")
struct ActMap : boost::statechart::event< ActMap > {};
struct Activate : boost::statechart::event< Activate > {};
struct Initialize : boost::statechart::event< Initialize > {};
+ struct Load : boost::statechart::event< Load > {};
/* States */
};
struct Started;
+ struct Reset;
struct Initial :
boost::statechart::state< Initial, RecoveryMachine >, NamedState {
typedef boost::mpl::list <
boost::statechart::transition< Initialize, Started >,
+ boost::statechart::transition< Load, Reset >,
boost::statechart::transition< boost::statechart::event_base, Crashed >
> reactions;
Initial(my_context ctx);
void handle_activate_map(RecoveryCtx *ctx);
void handle_backlog_generated(RecoveryCtx *ctx);
void handle_create(RecoveryCtx *ctx);
+ void handle_loaded(RecoveryCtx *ctx);
} recovery_state;
protected:
void handle_create(RecoveryCtx *rctx) {
recovery_state.handle_create(rctx);
}
+ void handle_loaded(RecoveryCtx *rctx) {
+ recovery_state.handle_loaded(rctx);
+ }
+
// abstract bits
virtual void do_op(MOSDOp *op) = 0;