}
boost::statechart::result
-BackfillState::PrimaryScanning::react(CancelBackfill evt)
+BackfillState::PrimaryScanning::react(SuspendBackfill evt)
{
LOG_PREFIX(BackfillState::PrimaryScanning::react::SuspendBackfill);
DEBUGDPP("suspended within PrimaryScanning", pg());
}
boost::statechart::result
-BackfillState::ReplicasScanning::react(CancelBackfill evt)
+BackfillState::ReplicasScanning::react(SuspendBackfill evt)
{
LOG_PREFIX(BackfillState::ReplicasScanning::react::SuspendBackfill);
DEBUGDPP("suspended within ReplicasScanning", pg());
}
boost::statechart::result
-BackfillState::Waiting::react(CancelBackfill evt)
+BackfillState::Waiting::react(SuspendBackfill evt)
{
LOG_PREFIX(BackfillState::Waiting::react::SuspendBackfill);
DEBUGDPP("suspended within Waiting", pg());
struct RequestDone : sc::event<RequestDone> {
};
- struct CancelBackfill : sc::event<CancelBackfill> {
+ struct SuspendBackfill : sc::event<SuspendBackfill> {
};
private:
sc::custom_reaction<ObjectPushed>,
sc::custom_reaction<PrimaryScanned>,
sc::transition<RequestDone, Done>,
- sc::custom_reaction<CancelBackfill>,
+ sc::custom_reaction<SuspendBackfill>,
sc::custom_reaction<Triggered>,
sc::transition<sc::event_base, Crashed>>;
explicit PrimaryScanning(my_context);
sc::result react(ObjectPushed);
// collect scanning result and transit to Enqueuing.
sc::result react(PrimaryScanned);
- sc::result react(CancelBackfill);
+ sc::result react(SuspendBackfill);
sc::result react(Triggered);
};
using reactions = boost::mpl::list<
sc::custom_reaction<ObjectPushed>,
sc::custom_reaction<ReplicaScanned>,
- sc::custom_reaction<CancelBackfill>,
+ sc::custom_reaction<SuspendBackfill>,
sc::custom_reaction<Triggered>,
sc::transition<RequestDone, Done>,
sc::transition<sc::event_base, Crashed>>;
// to Enqueuing will happen.
sc::result react(ObjectPushed);
sc::result react(ReplicaScanned);
- sc::result react(CancelBackfill);
+ sc::result react(SuspendBackfill);
sc::result react(Triggered);
// indicate whether a particular peer should be scanned to retrieve
using reactions = boost::mpl::list<
sc::custom_reaction<ObjectPushed>,
sc::transition<RequestDone, Done>,
- sc::custom_reaction<CancelBackfill>,
+ sc::custom_reaction<SuspendBackfill>,
sc::custom_reaction<Triggered>,
sc::transition<sc::event_base, Crashed>>;
explicit Waiting(my_context);
sc::result react(ObjectPushed);
- sc::result react(CancelBackfill);
+ sc::result react(SuspendBackfill);
sc::result react(Triggered);
};
struct Done : sc::state<Done, BackfillMachine>,
StateHelper<Done> {
using reactions = boost::mpl::list<
- sc::custom_reaction<CancelBackfill>,
+ sc::custom_reaction<SuspendBackfill>,
sc::transition<sc::event_base, Crashed>>;
explicit Done(my_context);
- sc::result react(CancelBackfill) {
+ sc::result react(SuspendBackfill) {
return discard_event();
}
};
void on_backfill_reserved() final {
recovery_handler->on_backfill_reserved();
}
- void on_backfill_canceled() final {
- recovery_handler->backfill_cancelled();
+ void on_backfill_suspended() final {
+ recovery_handler->backfill_suspended();
}
void on_recovery_cancelled() final {
PeeringState::Backfilled{});
}
-void PGRecovery::backfill_cancelled()
+void PGRecovery::backfill_suspended()
{
// We are not creating a new BackfillRecovery request here, as we
// need to cancel the backfill synchronously (before this method returns).
using BackfillState = crimson::osd::BackfillState;
backfill_state->process_event(
- BackfillState::CancelBackfill{}.intrusive_from_this());
+ BackfillState::SuspendBackfill{}.intrusive_from_this());
}
void PGRecovery::dispatch_backfill_event(
template <class EventT>
void start_backfill_recovery(
const EventT& evt);
- void backfill_cancelled();
+ void backfill_suspended();
void request_replica_scan(
const pg_shard_t& target,
const hobject_t& begin,
queue_recovery();
}
-void PG::on_backfill_canceled()
+void PG::on_backfill_suspended()
{
+ // Scan replies asked before suspending this backfill should be ignored.
+ // See PrimaryLogPG::do_scan - case MOSDPGScan::OP_SCAN_DIGEST.
+ // `waiting_on_backfill` will be re-refilled after the suspended backfill
+ // is resumed/restarted.
if (!waiting_on_backfill.empty()) {
waiting_on_backfill.clear();
finish_recovery_op(hobject_t::get_max());
void queue_snap_retrim(snapid_t snap);
void on_backfill_reserved() override;
- void on_backfill_canceled() override;
+ void on_backfill_suspended() override;
void on_recovery_cancelled() override {}
void on_recovery_reserved() override;
}
}
-void PeeringState::Backfilling::cancel_backfill()
+void PeeringState::Backfilling::suspend_backfill()
{
DECLARE_LOCALS;
backfill_release_reservations();
- pl->on_backfill_canceled();
+ pl->on_backfill_suspended();
}
boost::statechart::result
psdout(10) << "defer backfill, retry delay " << c.delay << dendl;
ps->state_set(PG_STATE_BACKFILL_WAIT);
ps->state_clear(PG_STATE_BACKFILLING);
- cancel_backfill();
+ suspend_backfill();
pl->schedule_event_after(
std::make_shared<PGPeeringEvent>(
psdout(10) << "backfill has unfound, can't continue" << dendl;
ps->state_set(PG_STATE_BACKFILL_UNFOUND);
ps->state_clear(PG_STATE_BACKFILLING);
- cancel_backfill();
+ suspend_backfill();
return transit<NotBackfilling>();
}
ps->state_set(PG_STATE_BACKFILL_TOOFULL);
ps->state_clear(PG_STATE_BACKFILLING);
- cancel_backfill();
+ suspend_backfill();
pl->schedule_event_after(
std::make_shared<PGPeeringEvent>(
{
DECLARE_LOCALS;
ps->state_set(PG_STATE_BACKFILL_WAIT);
- cancel_backfill();
+ suspend_backfill();
if (ps->needs_backfill()) {
return transit<WaitLocalBackfillReserved>();
} else {
// ============ recovery reservation notifications ==========
virtual void on_backfill_reserved() = 0;
- virtual void on_backfill_canceled() = 0;
+ virtual void on_backfill_suspended() = 0;
virtual void on_recovery_reserved() = 0;
virtual void on_recovery_cancelled() = 0;
boost::statechart::result react(const RemoteReservationRevoked& evt);
boost::statechart::result react(const DeferBackfill& evt);
boost::statechart::result react(const UnfoundBackfill& evt);
- void cancel_backfill();
+ void suspend_backfill();
void exit();
};
{
auto dpp = get_dpp();
if (osd->check_backfill_full(dpp)) {
- dout(1) << __func__ << ": Canceling backfill: Full." << dendl;
+ dout(1) << __func__ << ": Suspending backfill: Full." << dendl;
queue_peering_event(
PGPeeringEventRef(
std::make_shared<PGPeeringEvent>(
} else {
// we canceled backfill for a while due to a too full, and this
// is an extra response from a non-too-full peer
- dout(20) << __func__ << " canceled backfill (too full?)" << dendl;
+ dout(20) << __func__ << " suspended backfill (too full?)" << dendl;
}
}
break;
struct PGFacade;
void cancel() {
- schedule_event_immediate(crimson::osd::BackfillState::CancelBackfill{});
+ schedule_event_immediate(crimson::osd::BackfillState::SuspendBackfill{});
}
void resume() {
EXPECT_CALL(cluster_fixture, backfilled);
cluster_fixture.cancel();
- cluster_fixture.next_round2<crimson::osd::BackfillState::CancelBackfill>();
+ cluster_fixture.next_round2<crimson::osd::BackfillState::SuspendBackfill>();
cluster_fixture.next_round2<crimson::osd::BackfillState::PrimaryScanned>();
cluster_fixture.resume();
cluster_fixture.next_round2<crimson::osd::BackfillState::Triggered>();
EXPECT_CALL(cluster_fixture, backfilled);
cluster_fixture.next_round2<crimson::osd::BackfillState::PrimaryScanned>();
cluster_fixture.cancel();
- cluster_fixture.next_round2<crimson::osd::BackfillState::CancelBackfill>();
+ cluster_fixture.next_round2<crimson::osd::BackfillState::SuspendBackfill>();
cluster_fixture.resume();
cluster_fixture.next_round2<crimson::osd::BackfillState::Triggered>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ReplicaScanned>();
cluster_fixture.next_round2<crimson::osd::BackfillState::PrimaryScanned>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ReplicaScanned>();
cluster_fixture.cancel();
- cluster_fixture.next_round2<crimson::osd::BackfillState::CancelBackfill>();
+ cluster_fixture.next_round2<crimson::osd::BackfillState::SuspendBackfill>();
cluster_fixture.resume();
cluster_fixture.next_round2<crimson::osd::BackfillState::Triggered>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ReplicaScanned>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ReplicaScanned>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ReplicaScanned>();
cluster_fixture.cancel();
- cluster_fixture.next_round2<crimson::osd::BackfillState::CancelBackfill>();
+ cluster_fixture.next_round2<crimson::osd::BackfillState::SuspendBackfill>();
cluster_fixture.resume();
cluster_fixture.next_round2<crimson::osd::BackfillState::Triggered>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ObjectPushed>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ReplicaScanned>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ObjectPushed>();
cluster_fixture.cancel();
- cluster_fixture.next_round2<crimson::osd::BackfillState::CancelBackfill>();
+ cluster_fixture.next_round2<crimson::osd::BackfillState::SuspendBackfill>();
cluster_fixture.resume();
cluster_fixture.next_round2<crimson::osd::BackfillState::Triggered>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ObjectPushed>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ReplicaScanned>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ObjectPushed>();
cluster_fixture.cancel();
- cluster_fixture.next_round2<crimson::osd::BackfillState::CancelBackfill>();
+ cluster_fixture.next_round2<crimson::osd::BackfillState::SuspendBackfill>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ObjectPushed>();
cluster_fixture.next_round2<crimson::osd::BackfillState::ObjectPushed>();
cluster_fixture.resume();