}
// all good!
- post_event(CheckRepops());
+ post_event(Activate(pg->get_osdmap()->get_epoch()));
}
}
} else {
dout(10) << "Got last missing, don't need missing "
<< "posting CheckRepops" << dendl;
- post_event(CheckRepops());
+ post_event(Activate(pg->get_osdmap()->get_epoch()));
}
}
return discard_event();
pg->osd->recoverystate_perf->tinc(rs_getmissing_latency, dur);
}
-/*---WaitFlushedPeering---*/
-PG::RecoveryState::WaitFlushedPeering::WaitFlushedPeering(my_context ctx)
- : my_base(ctx),
- NamedState(context< RecoveryMachine >().pg->cct, "Started/Primary/Peering/WaitFlushedPeering")
-{
- PG *pg = context< RecoveryMachine >().pg;
- context< RecoveryMachine >().log_enter(state_name);
- if (context< RecoveryMachine >().pg->flushes_in_progress == 0)
- post_event(Activate(pg->get_osdmap()->get_epoch()));
-}
-
-boost::statechart::result
-PG::RecoveryState::WaitFlushedPeering::react(const FlushedEvt &evt)
-{
- PG *pg = context< RecoveryMachine >().pg;
- pg->on_flushed();
- return transit< WaitFlushedPeering >();
-}
-
-boost::statechart::result
-PG::RecoveryState::WaitFlushedPeering::react(const QueryState &q)
-{
- q.f->open_object_section("state");
- q.f->dump_string("name", state_name);
- q.f->dump_stream("enter_time") << enter_time;
- q.f->dump_string("comment", "waiting for flush");
- return forward_event();
-}
-
/*------WaitUpThru--------*/
PG::RecoveryState::WaitUpThru::WaitUpThru(my_context ctx)
: my_base(ctx),
{
PG *pg = context< RecoveryMachine >().pg;
if (!pg->need_up_thru) {
- post_event(CheckRepops());
+ post_event(Activate(pg->get_osdmap()->get_epoch()));
}
return forward_event();
}
};
struct WaitUpThru;
- struct WaitFlushedPeering;
struct GetMissing : boost::statechart::state< GetMissing, Peering >, NamedState {
set<pg_shard_t> peer_missing_requested;
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
boost::statechart::custom_reaction< MLogRec >,
- boost::statechart::transition< NeedUpThru, WaitUpThru >,
- boost::statechart::transition< CheckRepops, WaitFlushedPeering>
+ boost::statechart::transition< NeedUpThru, WaitUpThru >
> reactions;
boost::statechart::result react(const QueryState& q);
boost::statechart::result react(const MLogRec& logevt);
};
- struct WaitFlushedPeering :
- boost::statechart::state< WaitFlushedPeering, Peering>, NamedState {
- WaitFlushedPeering(my_context ctx);
- void exit() {}
- typedef boost::mpl::list <
- boost::statechart::custom_reaction< QueryState >,
- boost::statechart::custom_reaction< FlushedEvt >
- > reactions;
- boost::statechart::result react(const FlushedEvt& evt);
- boost::statechart::result react(const QueryState& q);
- };
-
struct WaitUpThru : boost::statechart::state< WaitUpThru, Peering >, NamedState {
WaitUpThru(my_context ctx);
void exit();
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
boost::statechart::custom_reaction< ActMap >,
- boost::statechart::transition< CheckRepops, WaitFlushedPeering>,
boost::statechart::custom_reaction< MLogRec >
> reactions;
boost::statechart::result react(const QueryState& q);