on_safe->push_back(new ContainerContext<FlushStateRef>(flush_trigger));
}
+void PG::reset_interval_flush()
+{
+ dout(10) << "Clearing blocked outgoing recovery messages" << dendl;
+ recovery_state.clear_blocked_outgoing();
+
+ if (!osr->flush_commit(
+ new QueuePeeringEvt<IntervalFlush>(
+ this, get_osdmap()->get_epoch(), IntervalFlush()))) {
+ dout(10) << "Beginning to block outgoing recovery messages" << dendl;
+ recovery_state.begin_block_outgoing();
+ } else {
+ dout(10) << "Not blocking outgoing recovery messages" << dendl;
+ }
+}
+
/* Called before initializing peering during advance_map */
void PG::start_peering_interval(
const OSDMapRef lastmap,
const OSDMapRef osdmap = get_osdmap();
set_last_peering_reset();
+ reset_interval_flush();
vector<int> oldacting, oldup;
int oldrole = get_role();
context< RecoveryMachine >().log_enter(state_name);
}
+boost::statechart::result
+PG::RecoveryState::Started::react(const IntervalFlush&)
+{
+ dout(10) << "Ending blocked outgoing recovery messages" << dendl;
+ context< RecoveryMachine >().pg->recovery_state.end_block_outgoing();
+ return discard_event();
+}
+
+
boost::statechart::result
PG::RecoveryState::Started::react(const FlushedEvt&)
{
{
context< RecoveryMachine >().log_enter(state_name);
PG *pg = context< RecoveryMachine >().pg;
+
pg->flushes_in_progress = 0;
pg->set_last_peering_reset();
}
return discard_event();
}
+boost::statechart::result
+PG::RecoveryState::Reset::react(const IntervalFlush&)
+{
+ dout(10) << "Ending blocked outgoing recovery messages" << dendl;
+ context< RecoveryMachine >().pg->recovery_state.end_block_outgoing();
+ return discard_event();
+}
+
boost::statechart::result PG::RecoveryState::Reset::react(const AdvMap& advmap)
{
PG *pg = context< RecoveryMachine >().pg;
TrivialEvent(AllReplicasActivated)
+ TrivialEvent(IntervalFlush)
+
/* Encapsulates PG recovery process */
class RecoveryState {
void start_handle(RecoveryCtx *new_ctx);
boost::statechart::custom_reaction< ActMap >,
boost::statechart::custom_reaction< NullEvt >,
boost::statechart::custom_reaction< FlushedEvt >,
+ boost::statechart::custom_reaction< IntervalFlush >,
boost::statechart::transition< boost::statechart::event_base, Crashed >
> reactions;
boost::statechart::result react(const QueryState& q);
boost::statechart::result react(const AdvMap&);
boost::statechart::result react(const ActMap&);
boost::statechart::result react(const FlushedEvt&);
+ boost::statechart::result react(const IntervalFlush&);
boost::statechart::result react(const boost::statechart::event_base&) {
return discard_event();
}
boost::statechart::custom_reaction< AdvMap >,
boost::statechart::custom_reaction< NullEvt >,
boost::statechart::custom_reaction< FlushedEvt >,
+ boost::statechart::custom_reaction< IntervalFlush >,
boost::statechart::transition< boost::statechart::event_base, Crashed >
> reactions;
boost::statechart::result react(const QueryState& q);
boost::statechart::result react(const AdvMap&);
boost::statechart::result react(const FlushedEvt&);
+ boost::statechart::result react(const IntervalFlush&);
boost::statechart::result react(const boost::statechart::event_base&) {
return discard_event();
}
/// share new pg log entries after a pg is active
void share_pg_log();
+ void reset_interval_flush();
void start_peering_interval(
const OSDMapRef lastmap,
const vector<int>& newup, int up_primary,