// kick any waiters
wake_pg_waiters(pg->info.pgid);
- map<int, map<pg_t, PG::Query> > query_map;
- map<int, MOSDPGInfo*> info_map;
- map<int, vector<PG::Info> > notify_list;
- PG::RecoveryCtx rctx(&query_map, &info_map, ¬ify_list,
- &((*pfin)->contexts), *pt);
- pg->handle_create(&rctx);
- do_queries(query_map);
- do_infos(info_map);
- do_notifies(notify_list);
} else {
// already had it. did the mapping change?
pg = _lookup_lock_pg(info.pgid);
void PG::proc_replica_info(int from, Info &oinfo)
{
+ dout(10) << "proc_replica_info osd" << from << " " << oinfo << dendl;
assert(is_primary());
peer_info[from] = oinfo;
might_have_unfound.insert(from);
context< RecoveryMachine >().log_enter(state_name);
}
+boost::statechart::result
+PG::RecoveryState::Initial::react(const MNotifyRec& notify) {
+ PG *pg = context< RecoveryMachine >().pg;
+ pg->proc_replica_info(notify.from, notify.info);
+ return transit< Primary >();
+}
+
+boost::statechart::result
+PG::RecoveryState::Initial::react(const MInfoRec& i) {
+ PG *pg = context< RecoveryMachine >().pg;
+ assert(!pg->is_primary());
+ post_event(i);
+ return transit< Stray >();
+}
+
+boost::statechart::result
+PG::RecoveryState::Initial::react(const MLogRec& i) {
+ PG *pg = context< RecoveryMachine >().pg;
+ assert(!pg->is_primary());
+ post_event(i);
+ return transit< Stray >();
+}
+
void PG::RecoveryState::Initial::exit() {
context< RecoveryMachine >().log_exit(state_name, enter_time);
}
typedef boost::mpl::list <
boost::statechart::transition< Initialize, Started >,
boost::statechart::transition< Load, Reset >,
+ boost::statechart::custom_reaction< MNotifyRec >,
+ boost::statechart::custom_reaction< MInfoRec >,
+ boost::statechart::custom_reaction< MLogRec >,
boost::statechart::transition< boost::statechart::event_base, Crashed >
> reactions;
Initial(my_context ctx);
void exit();
+
+ boost::statechart::result react(const MNotifyRec&);
+ boost::statechart::result react(const MInfoRec&);
+ boost::statechart::result react(const MLogRec&);
};
struct Reset :
struct Stray : boost::statechart::state< Stray, Started >, NamedState {
bool backlog_requested;
map<int, Query> pending_queries;
+
typedef boost::mpl::list <
boost::statechart::custom_reaction< MQuery >,
boost::statechart::custom_reaction< MLogRec >,
struct GetInfo :
boost::statechart::state< GetInfo, Peering >, NamedState {
set<int> peer_info_requested;
+
typedef boost::mpl::list <
boost::statechart::transition< GotInfo, GetLog >,
boost::statechart::custom_reaction< MNotifyRec >