]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/backfill_state: drop Cancelled
authorXuehan Xu <xuxuehan@qianxin.com>
Fri, 27 Sep 2024 01:51:20 +0000 (09:51 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Tue, 3 Dec 2024 08:16:26 +0000 (16:16 +0800)
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 <xuxuehan@qianxin.com>
src/crimson/osd/backfill_state.cc
src/crimson/osd/backfill_state.h

index 55ccb0ada13d3a5fc19eba9abe1760e7f7714995..62607c7fbebab0f1ae0cd3879bec178842691b64 100644 (file)
@@ -102,23 +102,6 @@ BackfillState::Initial::react(const BackfillState::Triggered& evt)
   }
 }
 
-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()
 {
@@ -502,8 +485,6 @@ BackfillState::ReplicasScanning::react(CancelBackfill evt)
 {
   LOG_PREFIX(BackfillState::ReplicasScanning::react::CancelBackfill);
   DEBUGDPP("cancelled within ReplicasScanning", pg());
-  waiting_on_backfill.clear();
-  return transit<Cancelled>();
 }
 
 boost::statechart::result
@@ -547,13 +528,6 @@ BackfillState::Crashed::Crashed()
   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
index da07a377b9277ccec31f1230acff54e69598d7d9..34400d930b2b9bb3dbc08d18463835763df710bd 100644 (file)
@@ -136,34 +136,10 @@ public:
     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().
@@ -234,7 +210,6 @@ public:
       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);
@@ -274,7 +249,6 @@ public:
     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);