Skip to content

Commit d643bde

Browse files
committed
osd/scrub: discard shallow-history usage in the FSM
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 <[email protected]>
1 parent e5c885f commit d643bde

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/osd/scrubber/scrub_machine.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,6 @@ ReplicaActive::ReplicaActive(my_context ctx)
760760
dout(10) << "-- state -->> ReplicaActive" << dendl;
761761
m_pg = scrbr->get_pg();
762762
m_osds = m_pg->get_pg_osd(ScrubberPasskey());
763-
clear_shallow_history<ReplicaIdle, 0>();
764-
clear_shallow_history<ReplicaActive, 0>();
765763
}
766764

767765
ReplicaActive::~ReplicaActive()
@@ -1048,7 +1046,6 @@ sc::result ReplicaWaitingReservation::react(const StartReplica& ev)
10481046
"reservation",
10491047
scrbr->get_whoami(), scrbr->get_spgid());
10501048
context<ReplicaActive>().clear_remote_reservation(true);
1051-
clear_shallow_history<ReplicaIdle, 0>();
10521049
post_event(ReplicaPushesUpd{});
10531050
return transit<ReplicaActiveOp>();
10541051
}
@@ -1153,7 +1150,7 @@ sc::result ReplicaActiveOp::react(const ReplicaRelease& ev)
11531150
{
11541151
dout(10) << "ReplicaActiveOp::react(const ReplicaRelease&)" << dendl;
11551152
post_event(ev);
1156-
return transit<sc::shallow_history<ReplicaReserved>>();
1153+
return transit<ReplicaReserved>();
11571154
}
11581155

11591156

@@ -1212,15 +1209,15 @@ sc::result ReplicaBuildingMap::react(const SchedReplica&)
12121209
dout(10) << "replica scrub job preempted" << dendl;
12131210

12141211
scrbr->send_preempted_replica();
1215-
return transit<sc::shallow_history<ReplicaReserved>>();
1212+
return transit<ReplicaReserved>();
12161213
}
12171214

12181215
// start or check progress of build_replica_map_chunk()
12191216
auto ret_init = scrbr->build_replica_map_chunk();
12201217
if (ret_init != -EINPROGRESS) {
12211218
dout(10) << "ReplicaBuildingMap::react(const SchedReplica&): back to idle"
12221219
<< dendl;
1223-
return transit<sc::shallow_history<ReplicaReserved>>();
1220+
return transit<ReplicaReserved>();
12241221
}
12251222

12261223
dout(20) << "ReplicaBuildingMap::react(const SchedReplica&): discarded"

src/osd/scrubber/scrub_machine.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <boost/statechart/event_base.hpp>
1111
#include <boost/statechart/in_state_reaction.hpp>
1212
#include <boost/statechart/simple_state.hpp>
13-
#include <boost/statechart/shallow_history.hpp>
1413
#include <boost/statechart/state.hpp>
1514
#include <boost/statechart/state_machine.hpp>
1615
#include <boost/statechart/transition.hpp>
@@ -764,8 +763,6 @@ struct WaitDigestUpdate : sc::state<WaitDigestUpdate, ActiveScrubbing>,
764763
* - initial state of ReplicaActive
765764
* - No scrubbing is performed in this state, but reservation-related
766765
* events are handled.
767-
* - uses 'shallow history', so that when returning from ReplicaActiveOp, we
768-
* return to where we were - either reserved by our primary, or unreserved.
769766
*
770767
* - sub-states:
771768
* * ReplicaUnreserved - not reserved by a primary. In this state we
@@ -937,8 +934,7 @@ struct ReplicaActive : sc::state<
937934
struct ReplicaIdle : sc::state<
938935
ReplicaIdle,
939936
ReplicaActive,
940-
ReplicaUnreserved,
941-
sc::has_shallow_history>,
937+
ReplicaUnreserved>,
942938
NamedSimply {
943939
explicit ReplicaIdle(my_context ctx);
944940
~ReplicaIdle() = default;

0 commit comments

Comments
 (0)