From 4a26aa169a46a8ba916c1f8a5bb8c0c9261e11a7 Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Wed, 27 Mar 2024 09:37:06 -0500 Subject: [PATCH] osd/scrub: ignore FullReset in all ReplicaActive states Signed-off-by: Ronen Friedman --- src/osd/scrubber/scrub_machine.cc | 14 +++++++------- src/osd/scrubber/scrub_machine.h | 21 ++++++++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/osd/scrubber/scrub_machine.cc b/src/osd/scrubber/scrub_machine.cc index d6c8cb4302862..4f0cd7b0c8eb7 100644 --- a/src/osd/scrubber/scrub_machine.cc +++ b/src/osd/scrubber/scrub_machine.cc @@ -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) diff --git a/src/osd/scrubber/scrub_machine.h b/src/osd/scrubber/scrub_machine.h index 3048b00688370..31625b55d43a6 100644 --- a/src/osd/scrubber/scrub_machine.h +++ b/src/osd/scrubber/scrub_machine.h @@ -823,11 +823,17 @@ struct ReplicaActive : sc::state, */ void clear_remote_reservation(bool warn_if_no_reservation); + void reset_ignored(const FullReset&); + using reactions = mpl::list< sc::transition, sc::custom_reaction, sc::custom_reaction, - sc::custom_reaction>; + sc::custom_reaction, + 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, struct ReplicaIdle : sc::state, NamedSimply { explicit ReplicaIdle(my_context ctx); ~ReplicaIdle() = default; - void reset_ignored(const FullReset&); - using reactions = mpl::list< - sc::custom_reaction, - sc::in_state_reaction< - FullReset, - ReplicaIdle, - &ReplicaIdle::reset_ignored>>; + using reactions = mpl::list>; - 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, sc::custom_reaction, - sc::custom_reaction, - sc::transition>; + sc::custom_reaction>; /** * Handling the unexpected (read - caused by a bug) case of receiving a -- 2.39.5