}
}
-boost::statechart::result
-BackfillState::Cancelled::react(const BackfillState::Triggered& evt)
-{
- LOG_PREFIX(BackfillState::Cancelled::react::Triggered);
- DEBUGDPP("backfill re-triggered", pg());
- ceph_assert(peering_state().is_backfilling());
- if (Enqueuing::all_enqueued(peering_state(),
- backfill_state().backfill_info,
- backfill_state().peer_backfill_info)) {
- DEBUGDPP("{}: switching to Done state", pg());
- return transit<BackfillState::Done>();
- } else {
- DEBUGDPP("{}: switching to Enqueuing state", pg());
- return transit<BackfillState::Enqueuing>();
- }
-}
-
// -- Enqueuing
void BackfillState::Enqueuing::maybe_update_range()
{
{
LOG_PREFIX(BackfillState::ReplicasScanning::react::CancelBackfill);
DEBUGDPP("cancelled within ReplicasScanning", pg());
- waiting_on_backfill.clear();
- return transit<Cancelled>();
}
boost::statechart::result
ceph_abort_msg("{}: this should not happen");
}
-// -- Cancelled
-BackfillState::Cancelled::Cancelled(my_context ctx)
- : my_base(ctx)
-{
- ceph_assert(peering_state().get_backfill_targets().size());
-}
-
// ProgressTracker is an intermediary between the BackfillListener and
// BackfillMachine + its states. All requests to push or drop an object
// are directed through it. The same happens with notifications about
explicit Crashed();
};
- struct Cancelled : sc::state<Cancelled, BackfillMachine>,
- StateHelper<Cancelled> {
- using reactions = boost::mpl::list<
- sc::custom_reaction<Triggered>,
- sc::custom_reaction<PrimaryScanned>,
- sc::custom_reaction<ReplicaScanned>,
- sc::custom_reaction<ObjectPushed>,
- sc::transition<sc::event_base, Crashed>>;
- explicit Cancelled(my_context);
- // resume after triggering backfill by on_activate_complete().
- // transit to Enqueuing.
- sc::result react(const Triggered&);
- sc::result react(const PrimaryScanned&) {
- return discard_event();
- }
- sc::result react(const ReplicaScanned&) {
- return discard_event();
- }
- sc::result react(const ObjectPushed&) {
- return discard_event();
- }
- };
-
struct Initial : sc::state<Initial, BackfillMachine>,
StateHelper<Initial> {
using reactions = boost::mpl::list<
sc::custom_reaction<Triggered>,
- sc::transition<CancelBackfill, Cancelled>,
sc::transition<sc::event_base, Crashed>>;
explicit Initial(my_context);
// initialize after triggering backfill by on_activate_complete().
sc::custom_reaction<ObjectPushed>,
sc::custom_reaction<PrimaryScanned>,
sc::transition<RequestDone, Done>,
- sc::transition<CancelBackfill, Cancelled>,
sc::transition<sc::event_base, Crashed>>;
explicit PrimaryScanning(my_context);
sc::result react(ObjectPushed);
using reactions = boost::mpl::list<
sc::custom_reaction<ObjectPushed>,
sc::transition<RequestDone, Done>,
- sc::transition<CancelBackfill, Cancelled>,
sc::transition<sc::event_base, Crashed>>;
explicit Waiting(my_context);
sc::result react(ObjectPushed);