]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/scrub: discard shallow-history usage in the FSM
authorRonen Friedman <rfriedma@redhat.com>
Mon, 25 Mar 2024 08:37:50 +0000 (03:37 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 9 Apr 2024 11:00:01 +0000 (06:00 -0500)
Due to the complexity of the shallow-history boost::statechart,
it is replaced by ReplicaActive reservation state flags.
In this commit - the history code is removed. The following commits
introduce the replacement.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
(cherry picked from commit d643bdedec7a1b747ef359bb5f6aa243a5ff3020)

src/osd/scrubber/scrub_machine.cc
src/osd/scrubber/scrub_machine.h

index 33da35cd8c85b3c2221c5d998807cee2a9e682e5..3346a258464843a3dd3dc335fae972246e6de0a2 100644 (file)
@@ -760,8 +760,6 @@ ReplicaActive::ReplicaActive(my_context ctx)
   dout(10) << "-- state -->> ReplicaActive" << dendl;
   m_pg = scrbr->get_pg();
   m_osds = m_pg->get_pg_osd(ScrubberPasskey());
-  clear_shallow_history<ReplicaIdle, 0>();
-  clear_shallow_history<ReplicaActive, 0>();
 }
 
 ReplicaActive::~ReplicaActive()
@@ -1048,7 +1046,6 @@ sc::result ReplicaWaitingReservation::react(const StartReplica& ev)
       "reservation",
       scrbr->get_whoami(), scrbr->get_spgid());
   context<ReplicaActive>().clear_remote_reservation(true);
-  clear_shallow_history<ReplicaIdle, 0>();
   post_event(ReplicaPushesUpd{});
   return transit<ReplicaActiveOp>();
 }
@@ -1153,7 +1150,7 @@ sc::result ReplicaActiveOp::react(const ReplicaRelease& ev)
 {
   dout(10) << "ReplicaActiveOp::react(const ReplicaRelease&)" << dendl;
   post_event(ev);
-  return transit<sc::shallow_history<ReplicaReserved>>();
+  return transit<ReplicaReserved>();
 }
 
 
@@ -1212,7 +1209,7 @@ sc::result ReplicaBuildingMap::react(const SchedReplica&)
     dout(10) << "replica scrub job preempted" << dendl;
 
     scrbr->send_preempted_replica();
-    return transit<sc::shallow_history<ReplicaReserved>>();
+    return transit<ReplicaReserved>();
   }
 
   // start or check progress of build_replica_map_chunk()
@@ -1220,7 +1217,7 @@ sc::result ReplicaBuildingMap::react(const SchedReplica&)
   if (ret_init != -EINPROGRESS) {
     dout(10) << "ReplicaBuildingMap::react(const SchedReplica&): back to idle"
             << dendl;
-    return transit<sc::shallow_history<ReplicaReserved>>();
+    return transit<ReplicaReserved>();
   }
 
   dout(20) << "ReplicaBuildingMap::react(const SchedReplica&): discarded"
index d56059c6bf87fd653ca51e2b9907411a898543ab..3810cba9a3bc57d1be03023be02cd2736c3b3603 100644 (file)
@@ -10,7 +10,6 @@
 #include <boost/statechart/event_base.hpp>
 #include <boost/statechart/in_state_reaction.hpp>
 #include <boost/statechart/simple_state.hpp>
-#include <boost/statechart/shallow_history.hpp>
 #include <boost/statechart/state.hpp>
 #include <boost/statechart/state_machine.hpp>
 #include <boost/statechart/transition.hpp>
@@ -764,8 +763,6 @@ struct WaitDigestUpdate : sc::state<WaitDigestUpdate, ActiveScrubbing>,
  *    - initial state of ReplicaActive
  *    - No scrubbing is performed in this state, but reservation-related
  *      events are handled.
- *    - uses 'shallow history', so that when returning from ReplicaActiveOp, we
- *       return to where we were - either reserved by our primary, or unreserved.
  *
  *    - sub-states:
  *      * ReplicaUnreserved - not reserved by a primary. In this state we
@@ -937,8 +934,7 @@ struct ReplicaActive : sc::state<
 struct ReplicaIdle : sc::state<
                         ReplicaIdle,
                         ReplicaActive,
-                        ReplicaUnreserved,
-                        sc::has_shallow_history>,
+                        ReplicaUnreserved>,
                     NamedSimply {
   explicit ReplicaIdle(my_context ctx);
   ~ReplicaIdle() = default;