]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: ignore FullReset in all ReplicaActive states
authorRonen Friedman <rfriedma@redhat.com>
Wed, 27 Mar 2024 14:37:06 +0000 (09:37 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 2 Apr 2024 11:16:01 +0000 (06:16 -0500)
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/scrub_machine.cc
src/osd/scrubber/scrub_machine.h

index d6c8cb43028626467cf25985bd01ed843f0cd0bf..4f0cd7b0c8eb755f6f4080f79223f8bae866876a 100644 (file)
@@ -940,6 +940,13 @@ sc::result ReplicaActive::react(const ReplicaRelease& ev)
 }
 
 
+void ReplicaActive::reset_ignored(const FullReset&)
+{
+  dout(10) << "ReplicaActive::react(const FullReset&): FullReset ignored"
+          << dendl;
+}
+
+
 // ---------------- ReplicaActive/ReplicaIdle ---------------------------
 
 ReplicaIdle::ReplicaIdle(my_context ctx)
@@ -969,13 +976,6 @@ sc::result ReplicaIdle::react(const StartReplica& ev)
 }
 
 
-void ReplicaIdle::reset_ignored(const FullReset&)
-{
-  dout(10) << "ReplicaIdle::react(const FullReset&): FullReset ignored"
-          << dendl;
-}
-
-
 // ------------- ReplicaActive/ReplicaActiveOp --------------------------
 
 ReplicaActiveOp::ReplicaActiveOp(my_context ctx)
index 3048b00688370932a3ddc046a0bc17500eac7cba..31625b55d43a68ca84e93ff2e34e3e6c4a07ae74 100644 (file)
@@ -823,11 +823,17 @@ struct ReplicaActive : sc::state<ReplicaActive, ScrubMachine, ReplicaIdle>,
    */
   void clear_remote_reservation(bool warn_if_no_reservation);
 
+  void reset_ignored(const FullReset&);
+
   using reactions = mpl::list<
       sc::transition<IntervalChanged, NotActive>,
       sc::custom_reaction<ReserverGranted>,
       sc::custom_reaction<ReplicaReserveReq>,
-      sc::custom_reaction<ReplicaRelease>>;
+      sc::custom_reaction<ReplicaRelease>,
+      sc::in_state_reaction<
+         FullReset,
+         ReplicaActive,
+         &ReplicaActive::reset_ignored>>;
 
   /// handle a reservation request from a primary
   sc::result react(const ReplicaReserveReq& ev);
@@ -904,15 +910,9 @@ struct ReplicaActive : sc::state<ReplicaActive, ScrubMachine, ReplicaIdle>,
 struct ReplicaIdle : sc::state<ReplicaIdle, ReplicaActive>, NamedSimply {
   explicit ReplicaIdle(my_context ctx);
   ~ReplicaIdle() = default;
-  void reset_ignored(const FullReset&);
-  using reactions = mpl::list<
-      sc::custom_reaction<StartReplica>,
-      sc::in_state_reaction<
-         FullReset,
-         ReplicaIdle,
-         &ReplicaIdle::reset_ignored>>;
+  using reactions = mpl::list<sc::custom_reaction<StartReplica>>;
 
- sc::result react(const StartReplica& ev);
 sc::result react(const StartReplica& ev);
 };
 
 
@@ -930,8 +930,7 @@ struct ReplicaActiveOp
   using reactions = mpl::list<
       sc::custom_reaction<StartReplica>,
       sc::custom_reaction<ReplicaRelease>,
-      sc::custom_reaction<ReplicaReserveReq>,
-      sc::transition<FullReset, ReplicaIdle>>;
+      sc::custom_reaction<ReplicaReserveReq>>;
 
   /**
    * Handling the unexpected (read - caused by a bug) case of receiving a