Skip to content

Commit 892cf56

Browse files
committed
crimson/osd/backfill_state: drop Cancelled
We'll implement the backfill cancellation as a simple pause of the backfill procedure, which means we don't have to add a new state Signed-off-by: Xuehan Xu <[email protected]>
1 parent 8f2ad5f commit 892cf56

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

src/crimson/osd/backfill_state.cc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,6 @@ BackfillState::Initial::react(const BackfillState::Triggered& evt)
102102
}
103103
}
104104

105-
boost::statechart::result
106-
BackfillState::Cancelled::react(const BackfillState::Triggered& evt)
107-
{
108-
LOG_PREFIX(BackfillState::Cancelled::react::Triggered);
109-
DEBUGDPP("backfill re-triggered", pg());
110-
ceph_assert(peering_state().is_backfilling());
111-
if (Enqueuing::all_enqueued(peering_state(),
112-
backfill_state().backfill_info,
113-
backfill_state().peer_backfill_info)) {
114-
DEBUGDPP("{}: switching to Done state", pg());
115-
return transit<BackfillState::Done>();
116-
} else {
117-
DEBUGDPP("{}: switching to Enqueuing state", pg());
118-
return transit<BackfillState::Enqueuing>();
119-
}
120-
}
121-
122105
// -- Enqueuing
123106
void BackfillState::Enqueuing::maybe_update_range()
124107
{
@@ -502,8 +485,6 @@ BackfillState::ReplicasScanning::react(CancelBackfill evt)
502485
{
503486
LOG_PREFIX(BackfillState::ReplicasScanning::react::CancelBackfill);
504487
DEBUGDPP("cancelled within ReplicasScanning", pg());
505-
waiting_on_backfill.clear();
506-
return transit<Cancelled>();
507488
}
508489

509490
boost::statechart::result
@@ -547,13 +528,6 @@ BackfillState::Crashed::Crashed()
547528
ceph_abort_msg("{}: this should not happen");
548529
}
549530

550-
// -- Cancelled
551-
BackfillState::Cancelled::Cancelled(my_context ctx)
552-
: my_base(ctx)
553-
{
554-
ceph_assert(peering_state().get_backfill_targets().size());
555-
}
556-
557531
// ProgressTracker is an intermediary between the BackfillListener and
558532
// BackfillMachine + its states. All requests to push or drop an object
559533
// are directed through it. The same happens with notifications about

src/crimson/osd/backfill_state.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -136,34 +136,10 @@ struct BackfillState {
136136
explicit Crashed();
137137
};
138138

139-
struct Cancelled : sc::state<Cancelled, BackfillMachine>,
140-
StateHelper<Cancelled> {
141-
using reactions = boost::mpl::list<
142-
sc::custom_reaction<Triggered>,
143-
sc::custom_reaction<PrimaryScanned>,
144-
sc::custom_reaction<ReplicaScanned>,
145-
sc::custom_reaction<ObjectPushed>,
146-
sc::transition<sc::event_base, Crashed>>;
147-
explicit Cancelled(my_context);
148-
// resume after triggering backfill by on_activate_complete().
149-
// transit to Enqueuing.
150-
sc::result react(const Triggered&);
151-
sc::result react(const PrimaryScanned&) {
152-
return discard_event();
153-
}
154-
sc::result react(const ReplicaScanned&) {
155-
return discard_event();
156-
}
157-
sc::result react(const ObjectPushed&) {
158-
return discard_event();
159-
}
160-
};
161-
162139
struct Initial : sc::state<Initial, BackfillMachine>,
163140
StateHelper<Initial> {
164141
using reactions = boost::mpl::list<
165142
sc::custom_reaction<Triggered>,
166-
sc::transition<CancelBackfill, Cancelled>,
167143
sc::transition<sc::event_base, Crashed>>;
168144
explicit Initial(my_context);
169145
// initialize after triggering backfill by on_activate_complete().
@@ -234,7 +210,6 @@ struct BackfillState {
234210
sc::custom_reaction<ObjectPushed>,
235211
sc::custom_reaction<PrimaryScanned>,
236212
sc::transition<RequestDone, Done>,
237-
sc::transition<CancelBackfill, Cancelled>,
238213
sc::transition<sc::event_base, Crashed>>;
239214
explicit PrimaryScanning(my_context);
240215
sc::result react(ObjectPushed);
@@ -274,7 +249,6 @@ struct BackfillState {
274249
using reactions = boost::mpl::list<
275250
sc::custom_reaction<ObjectPushed>,
276251
sc::transition<RequestDone, Done>,
277-
sc::transition<CancelBackfill, Cancelled>,
278252
sc::transition<sc::event_base, Crashed>>;
279253
explicit Waiting(my_context);
280254
sc::result react(ObjectPushed);

0 commit comments

Comments
 (0)