Skip to content

Commit 2fe3f07

Browse files
authored
Merge pull request ceph#61232 from xxhdx1985126/wip-67888-followup
osd/PeeringState: rename "cancel_backfill" to "suspend_backfill" Reviewed-by: Samuel Just <[email protected]>
2 parents a39568e + 29c4337 commit 2fe3f07

File tree

11 files changed

+40
-36
lines changed

11 files changed

+40
-36
lines changed

src/crimson/osd/backfill_state.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ BackfillState::PrimaryScanning::react(PrimaryScanned evt)
427427
}
428428

429429
boost::statechart::result
430-
BackfillState::PrimaryScanning::react(CancelBackfill evt)
430+
BackfillState::PrimaryScanning::react(SuspendBackfill evt)
431431
{
432432
LOG_PREFIX(BackfillState::PrimaryScanning::react::SuspendBackfill);
433433
DEBUGDPP("suspended within PrimaryScanning", pg());
@@ -523,7 +523,7 @@ BackfillState::ReplicasScanning::react(ReplicaScanned evt)
523523
}
524524

525525
boost::statechart::result
526-
BackfillState::ReplicasScanning::react(CancelBackfill evt)
526+
BackfillState::ReplicasScanning::react(SuspendBackfill evt)
527527
{
528528
LOG_PREFIX(BackfillState::ReplicasScanning::react::SuspendBackfill);
529529
DEBUGDPP("suspended within ReplicasScanning", pg());
@@ -576,7 +576,7 @@ BackfillState::Waiting::react(ObjectPushed evt)
576576
}
577577

578578
boost::statechart::result
579-
BackfillState::Waiting::react(CancelBackfill evt)
579+
BackfillState::Waiting::react(SuspendBackfill evt)
580580
{
581581
LOG_PREFIX(BackfillState::Waiting::react::SuspendBackfill);
582582
DEBUGDPP("suspended within Waiting", pg());

src/crimson/osd/backfill_state.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct BackfillState {
5959
struct RequestDone : sc::event<RequestDone> {
6060
};
6161

62-
struct CancelBackfill : sc::event<CancelBackfill> {
62+
struct SuspendBackfill : sc::event<SuspendBackfill> {
6363
};
6464

6565
struct ThrottleAcquired : sc::event<ThrottleAcquired> {
@@ -212,14 +212,14 @@ struct BackfillState {
212212
sc::custom_reaction<ObjectPushed>,
213213
sc::custom_reaction<PrimaryScanned>,
214214
sc::transition<RequestDone, Done>,
215-
sc::custom_reaction<CancelBackfill>,
215+
sc::custom_reaction<SuspendBackfill>,
216216
sc::custom_reaction<Triggered>,
217217
sc::transition<sc::event_base, Crashed>>;
218218
explicit PrimaryScanning(my_context);
219219
sc::result react(ObjectPushed);
220220
// collect scanning result and transit to Enqueuing.
221221
sc::result react(PrimaryScanned);
222-
sc::result react(CancelBackfill);
222+
sc::result react(SuspendBackfill);
223223
sc::result react(Triggered);
224224
};
225225

@@ -228,7 +228,7 @@ struct BackfillState {
228228
using reactions = boost::mpl::list<
229229
sc::custom_reaction<ObjectPushed>,
230230
sc::custom_reaction<ReplicaScanned>,
231-
sc::custom_reaction<CancelBackfill>,
231+
sc::custom_reaction<SuspendBackfill>,
232232
sc::custom_reaction<Triggered>,
233233
sc::transition<RequestDone, Done>,
234234
sc::transition<sc::event_base, Crashed>>;
@@ -237,7 +237,7 @@ struct BackfillState {
237237
// to Enqueuing will happen.
238238
sc::result react(ObjectPushed);
239239
sc::result react(ReplicaScanned);
240-
sc::result react(CancelBackfill);
240+
sc::result react(SuspendBackfill);
241241
sc::result react(Triggered);
242242

243243
// indicate whether a particular peer should be scanned to retrieve
@@ -257,23 +257,23 @@ struct BackfillState {
257257
using reactions = boost::mpl::list<
258258
sc::custom_reaction<ObjectPushed>,
259259
sc::transition<RequestDone, Done>,
260-
sc::custom_reaction<CancelBackfill>,
260+
sc::custom_reaction<SuspendBackfill>,
261261
sc::custom_reaction<Triggered>,
262262
sc::transition<ThrottleAcquired, Enqueuing>,
263263
sc::transition<sc::event_base, Crashed>>;
264264
explicit Waiting(my_context);
265265
sc::result react(ObjectPushed);
266-
sc::result react(CancelBackfill);
266+
sc::result react(SuspendBackfill);
267267
sc::result react(Triggered);
268268
};
269269

270270
struct Done : sc::state<Done, BackfillMachine>,
271271
StateHelper<Done> {
272272
using reactions = boost::mpl::list<
273-
sc::custom_reaction<CancelBackfill>,
273+
sc::custom_reaction<SuspendBackfill>,
274274
sc::transition<sc::event_base, Crashed>>;
275275
explicit Done(my_context);
276-
sc::result react(CancelBackfill) {
276+
sc::result react(SuspendBackfill) {
277277
return discard_event();
278278
}
279279
};

src/crimson/osd/pg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ class PG : public boost::intrusive_ref_counter<
434434
void on_backfill_reserved() final {
435435
recovery_handler->on_backfill_reserved();
436436
}
437-
void on_backfill_canceled() final {
438-
recovery_handler->backfill_cancelled();
437+
void on_backfill_suspended() final {
438+
recovery_handler->backfill_suspended();
439439
}
440440

441441
void on_recovery_cancelled() final {

src/crimson/osd/pg_recovery.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,13 +641,13 @@ void PGRecovery::backfilled()
641641
PeeringState::Backfilled{});
642642
}
643643

644-
void PGRecovery::backfill_cancelled()
644+
void PGRecovery::backfill_suspended()
645645
{
646646
// We are not creating a new BackfillRecovery request here, as we
647647
// need to cancel the backfill synchronously (before this method returns).
648648
using BackfillState = crimson::osd::BackfillState;
649649
backfill_state->process_event(
650-
BackfillState::CancelBackfill{}.intrusive_from_this());
650+
BackfillState::SuspendBackfill{}.intrusive_from_this());
651651
}
652652

653653
void PGRecovery::dispatch_backfill_event(

src/crimson/osd/pg_recovery.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class PGRecovery : public crimson::osd::BackfillState::BackfillListener {
107107
template <class EventT>
108108
void start_backfill_recovery(
109109
const EventT& evt);
110-
void backfill_cancelled();
110+
void backfill_suspended();
111111
void request_replica_scan(
112112
const pg_shard_t& target,
113113
const hobject_t& begin,

src/osd/PG.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,8 +1563,12 @@ void PG::on_backfill_reserved()
15631563
queue_recovery();
15641564
}
15651565

1566-
void PG::on_backfill_canceled()
1566+
void PG::on_backfill_suspended()
15671567
{
1568+
// Scan replies asked before suspending this backfill should be ignored.
1569+
// See PrimaryLogPG::do_scan - case MOSDPGScan::OP_SCAN_DIGEST.
1570+
// `waiting_on_backfill` will be re-refilled after the suspended backfill
1571+
// is resumed/restarted.
15681572
if (!waiting_on_backfill.empty()) {
15691573
waiting_on_backfill.clear();
15701574
finish_recovery_op(hobject_t::get_max());

src/osd/PG.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ class PG : public DoutPrefixProvider,
604604
void queue_snap_retrim(snapid_t snap);
605605

606606
void on_backfill_reserved() override;
607-
void on_backfill_canceled() override;
607+
void on_backfill_suspended() override;
608608
void on_recovery_cancelled() override {}
609609
void on_recovery_reserved() override;
610610

src/osd/PeeringState.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5106,11 +5106,11 @@ void PeeringState::Backfilling::backfill_release_reservations()
51065106
}
51075107
}
51085108

5109-
void PeeringState::Backfilling::cancel_backfill()
5109+
void PeeringState::Backfilling::suspend_backfill()
51105110
{
51115111
DECLARE_LOCALS;
51125112
backfill_release_reservations();
5113-
pl->on_backfill_canceled();
5113+
pl->on_backfill_suspended();
51145114
}
51155115

51165116
boost::statechart::result
@@ -5128,7 +5128,7 @@ PeeringState::Backfilling::react(const DeferBackfill &c)
51285128
psdout(10) << "defer backfill, retry delay " << c.delay << dendl;
51295129
ps->state_set(PG_STATE_BACKFILL_WAIT);
51305130
ps->state_clear(PG_STATE_BACKFILLING);
5131-
cancel_backfill();
5131+
suspend_backfill();
51325132

51335133
pl->schedule_event_after(
51345134
std::make_shared<PGPeeringEvent>(
@@ -5146,7 +5146,7 @@ PeeringState::Backfilling::react(const UnfoundBackfill &c)
51465146
psdout(10) << "backfill has unfound, can't continue" << dendl;
51475147
ps->state_set(PG_STATE_BACKFILL_UNFOUND);
51485148
ps->state_clear(PG_STATE_BACKFILLING);
5149-
cancel_backfill();
5149+
suspend_backfill();
51505150
return transit<NotBackfilling>();
51515151
}
51525152

@@ -5157,7 +5157,7 @@ PeeringState::Backfilling::react(const RemoteReservationRevokedTooFull &)
51575157

51585158
ps->state_set(PG_STATE_BACKFILL_TOOFULL);
51595159
ps->state_clear(PG_STATE_BACKFILLING);
5160-
cancel_backfill();
5160+
suspend_backfill();
51615161

51625162
pl->schedule_event_after(
51635163
std::make_shared<PGPeeringEvent>(
@@ -5174,7 +5174,7 @@ PeeringState::Backfilling::react(const RemoteReservationRevoked &)
51745174
{
51755175
DECLARE_LOCALS;
51765176
ps->state_set(PG_STATE_BACKFILL_WAIT);
5177-
cancel_backfill();
5177+
suspend_backfill();
51785178
if (ps->needs_backfill()) {
51795179
return transit<WaitLocalBackfillReserved>();
51805180
} else {

src/osd/PeeringState.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ class PeeringState : public MissingLoc::MappingInfo {
417417

418418
// ============ recovery reservation notifications ==========
419419
virtual void on_backfill_reserved() = 0;
420-
virtual void on_backfill_canceled() = 0;
420+
virtual void on_backfill_suspended() = 0;
421421
virtual void on_recovery_reserved() = 0;
422422
virtual void on_recovery_cancelled() = 0;
423423

@@ -963,7 +963,7 @@ class PeeringState : public MissingLoc::MappingInfo {
963963
boost::statechart::result react(const RemoteReservationRevoked& evt);
964964
boost::statechart::result react(const DeferBackfill& evt);
965965
boost::statechart::result react(const UnfoundBackfill& evt);
966-
void cancel_backfill();
966+
void suspend_backfill();
967967
void exit();
968968
};
969969

src/osd/PrimaryLogPG.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4495,7 +4495,7 @@ void PrimaryLogPG::do_scan(
44954495
{
44964496
auto dpp = get_dpp();
44974497
if (osd->check_backfill_full(dpp)) {
4498-
dout(1) << __func__ << ": Canceling backfill: Full." << dendl;
4498+
dout(1) << __func__ << ": Suspending backfill: Full." << dendl;
44994499
queue_peering_event(
45004500
PGPeeringEventRef(
45014501
std::make_shared<PGPeeringEvent>(
@@ -4552,7 +4552,7 @@ void PrimaryLogPG::do_scan(
45524552
} else {
45534553
// we canceled backfill for a while due to a too full, and this
45544554
// is an extra response from a non-too-full peer
4555-
dout(20) << __func__ << " canceled backfill (too full?)" << dendl;
4555+
dout(20) << __func__ << " suspended backfill (too full?)" << dendl;
45564556
}
45574557
}
45584558
break;

0 commit comments

Comments
 (0)