Skip to content

Commit 4a26aa1

Browse files
committed
osd/scrub: ignore FullReset in all ReplicaActive states
Signed-off-by: Ronen Friedman <[email protected]>
1 parent 03a2f8c commit 4a26aa1

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/osd/scrubber/scrub_machine.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,13 @@ sc::result ReplicaActive::react(const ReplicaRelease& ev)
940940
}
941941

942942

943+
void ReplicaActive::reset_ignored(const FullReset&)
944+
{
945+
dout(10) << "ReplicaActive::react(const FullReset&): FullReset ignored"
946+
<< dendl;
947+
}
948+
949+
943950
// ---------------- ReplicaActive/ReplicaIdle ---------------------------
944951

945952
ReplicaIdle::ReplicaIdle(my_context ctx)
@@ -969,13 +976,6 @@ sc::result ReplicaIdle::react(const StartReplica& ev)
969976
}
970977

971978

972-
void ReplicaIdle::reset_ignored(const FullReset&)
973-
{
974-
dout(10) << "ReplicaIdle::react(const FullReset&): FullReset ignored"
975-
<< dendl;
976-
}
977-
978-
979979
// ------------- ReplicaActive/ReplicaActiveOp --------------------------
980980

981981
ReplicaActiveOp::ReplicaActiveOp(my_context ctx)

src/osd/scrubber/scrub_machine.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,17 @@ struct ReplicaActive : sc::state<ReplicaActive, ScrubMachine, ReplicaIdle>,
823823
*/
824824
void clear_remote_reservation(bool warn_if_no_reservation);
825825

826+
void reset_ignored(const FullReset&);
827+
826828
using reactions = mpl::list<
827829
sc::transition<IntervalChanged, NotActive>,
828830
sc::custom_reaction<ReserverGranted>,
829831
sc::custom_reaction<ReplicaReserveReq>,
830-
sc::custom_reaction<ReplicaRelease>>;
832+
sc::custom_reaction<ReplicaRelease>,
833+
sc::in_state_reaction<
834+
FullReset,
835+
ReplicaActive,
836+
&ReplicaActive::reset_ignored>>;
831837

832838
/// handle a reservation request from a primary
833839
sc::result react(const ReplicaReserveReq& ev);
@@ -904,15 +910,9 @@ struct ReplicaActive : sc::state<ReplicaActive, ScrubMachine, ReplicaIdle>,
904910
struct ReplicaIdle : sc::state<ReplicaIdle, ReplicaActive>, NamedSimply {
905911
explicit ReplicaIdle(my_context ctx);
906912
~ReplicaIdle() = default;
907-
void reset_ignored(const FullReset&);
908-
using reactions = mpl::list<
909-
sc::custom_reaction<StartReplica>,
910-
sc::in_state_reaction<
911-
FullReset,
912-
ReplicaIdle,
913-
&ReplicaIdle::reset_ignored>>;
913+
using reactions = mpl::list<sc::custom_reaction<StartReplica>>;
914914

915-
sc::result react(const StartReplica& ev);
915+
sc::result react(const StartReplica& ev);
916916
};
917917

918918

@@ -930,8 +930,7 @@ struct ReplicaActiveOp
930930
using reactions = mpl::list<
931931
sc::custom_reaction<StartReplica>,
932932
sc::custom_reaction<ReplicaRelease>,
933-
sc::custom_reaction<ReplicaReserveReq>,
934-
sc::transition<FullReset, ReplicaIdle>>;
933+
sc::custom_reaction<ReplicaReserveReq>>;
935934

936935
/**
937936
* Handling the unexpected (read - caused by a bug) case of receiving a

0 commit comments

Comments
 (0)