Skip to content

Commit 03ed3af

Browse files
committed
crimson/osd: clean up BackfillRecovery
Signed-off-by: Xuehan Xu <[email protected]>
1 parent 865839f commit 03ed3af

File tree

6 files changed

+3
-90
lines changed

6 files changed

+3
-90
lines changed

src/crimson/osd/osd_operation_external_tracking.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,6 @@ struct EventBackendRegistry<osd::RecoverySubRequest> {
342342
}
343343
};
344344

345-
template <>
346-
struct EventBackendRegistry<osd::BackfillRecovery> {
347-
static std::tuple<> get_backends() {
348-
return {};
349-
}
350-
};
351-
352345
template <>
353346
struct EventBackendRegistry<osd::PGAdvanceMap> {
354347
static std::tuple<> get_backends() {

src/crimson/osd/osd_operations/background_recovery.cc

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -175,41 +175,7 @@ PglogBasedRecovery::do_recovery()
175175
});
176176
}
177177

178-
PGPeeringPipeline &BackfillRecovery::peering_pp(PG &pg)
179-
{
180-
return pg.peering_request_pg_pipeline;
181-
}
182-
183-
BackfillRecovery::interruptible_future<bool>
184-
BackfillRecovery::do_recovery()
185-
{
186-
LOG_PREFIX(BackfillRecovery::do_recovery);
187-
DEBUGDPPI("{}", *pg, __func__);
188-
189-
if (pg->has_reset_since(epoch_started)) {
190-
DEBUGDPPI("{}: pg got reset since epoch_started={}",
191-
*pg, __func__, epoch_started);
192-
return seastar::make_ready_future<bool>(false);
193-
}
194-
// TODO: limits
195-
return enter_stage<interruptor>(
196-
// process_event() of our boost::statechart machine is non-reentrant.
197-
// with the backfill_pipeline we protect it from a second entry from
198-
// the implementation of BackfillListener.
199-
// additionally, this stage serves to synchronize with PeeringEvent.
200-
peering_pp(*pg).process
201-
).then_interruptible([this] {
202-
pg->get_recovery_handler()->dispatch_backfill_event(std::move(evt));
203-
return handle.complete();
204-
}).then_interruptible([] {
205-
return seastar::make_ready_future<bool>(false);
206-
}).finally([this] {
207-
handle.exit();
208-
});
209-
}
210-
211178
template class BackgroundRecoveryT<UrgentRecovery>;
212179
template class BackgroundRecoveryT<PglogBasedRecovery>;
213-
template class BackgroundRecoveryT<BackfillRecovery>;
214180

215181
} // namespace crimson::osd

src/crimson/osd/osd_operations/background_recovery.h

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ class BackgroundRecoveryT : public PhasedOperationT<T> {
5252

5353
/// represent a recovery initiated for serving a client request
5454
///
55-
/// unlike @c PglogBasedRecovery and @c BackfillRecovery,
56-
/// @c UrgentRecovery is not throttled by the scheduler. and it
57-
/// utilizes @c RecoveryBackend directly to recover the unreadable
58-
/// object.
55+
/// unlike @c PglogBasedRecovery, @c UrgentRecovery is not throttled
56+
/// by the scheduler. and it utilizes @c RecoveryBackend directly to
57+
/// recover the unreadable object.
5958
class UrgentRecovery final : public BackgroundRecoveryT<UrgentRecovery> {
6059
public:
6160
UrgentRecovery(
@@ -107,49 +106,9 @@ class PglogBasedRecovery final : public BackgroundRecoveryT<PglogBasedRecovery>
107106
bool cancelled = false;
108107
};
109108

110-
class BackfillRecovery final : public BackgroundRecoveryT<BackfillRecovery> {
111-
public:
112-
113-
template <class EventT>
114-
BackfillRecovery(
115-
Ref<PG> pg,
116-
ShardServices &ss,
117-
epoch_t epoch_started,
118-
const EventT& evt);
119-
120-
PipelineHandle& get_handle() { return handle; }
121-
122-
std::tuple<
123-
OperationThrottler::BlockingEvent,
124-
PGPeeringPipeline::Process::BlockingEvent
125-
> tracking_events;
126-
127-
private:
128-
boost::intrusive_ptr<const boost::statechart::event_base> evt;
129-
PipelineHandle handle;
130-
131-
static PGPeeringPipeline &peering_pp(PG &pg);
132-
interruptible_future<bool> do_recovery() override;
133-
};
134-
135-
template <class EventT>
136-
BackfillRecovery::BackfillRecovery(
137-
Ref<PG> pg,
138-
ShardServices &ss,
139-
const epoch_t epoch_started,
140-
const EventT& evt)
141-
: BackgroundRecoveryT(
142-
std::move(pg),
143-
ss,
144-
epoch_started,
145-
crimson::osd::scheduler::scheduler_class_t::background_best_effort),
146-
evt(evt.intrusive_from_this())
147-
{}
148-
149109
}
150110

151111
#if FMT_VERSION >= 90000
152-
template <> struct fmt::formatter<crimson::osd::BackfillRecovery> : fmt::ostream_formatter {};
153112
template <> struct fmt::formatter<crimson::osd::PglogBasedRecovery> : fmt::ostream_formatter {};
154113
template <> struct fmt::formatter<crimson::osd::UrgentRecovery> : fmt::ostream_formatter {};
155114
template <class T> struct fmt::formatter<crimson::osd::BackgroundRecoveryT<T>> : fmt::ostream_formatter {};

src/crimson/osd/osd_operations/peering_event.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace crimson::osd {
2121
class OSD;
2222
class ShardServices;
2323
class PG;
24-
class BackfillRecovery;
2524

2625
template <class T>
2726
class PeeringEvent : public PhasedOperationT<T> {

src/crimson/osd/pg.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ namespace crimson::os {
6464

6565
namespace crimson::osd {
6666
class OpsExecuter;
67-
class BackfillRecovery;
6867
class SnapTrimEvent;
6968
class PglogBasedRecovery;
7069

@@ -892,7 +891,6 @@ class PG : public boost::intrusive_ref_counter<
892891
friend class RepRequest;
893892
friend class LogMissingRequest;
894893
friend class LogMissingRequestReply;
895-
friend class BackfillRecovery;
896894
friend struct PGFacade;
897895
friend class InternalClientRequest;
898896
friend class WatchTimeoutRequest;

src/crimson/osd/pg_recovery.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,6 @@ void PGRecovery::backfilled()
639639

640640
void PGRecovery::backfill_suspended()
641641
{
642-
// We are not creating a new BackfillRecovery request here, as we
643-
// need to cancel the backfill synchronously (before this method returns).
644642
using BackfillState = crimson::osd::BackfillState;
645643
backfill_state->process_event(
646644
BackfillState::SuspendBackfill{}.intrusive_from_this());

0 commit comments

Comments
 (0)