From: Xuehan Xu Date: Mon, 16 Dec 2024 05:50:48 +0000 (+0800) Subject: crimson/osd: clean up BackfillRecovery X-Git-Tag: v20.0.0~87^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=03ed3af2a504caac44a5a3f46fdba0bd8378a0b8;p=ceph.git crimson/osd: clean up BackfillRecovery Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/osd/osd_operation_external_tracking.h b/src/crimson/osd/osd_operation_external_tracking.h index 6a2d7e3ccbd1..0f70e8407a2b 100644 --- a/src/crimson/osd/osd_operation_external_tracking.h +++ b/src/crimson/osd/osd_operation_external_tracking.h @@ -342,13 +342,6 @@ struct EventBackendRegistry { } }; -template <> -struct EventBackendRegistry { - static std::tuple<> get_backends() { - return {}; - } -}; - template <> struct EventBackendRegistry { static std::tuple<> get_backends() { diff --git a/src/crimson/osd/osd_operations/background_recovery.cc b/src/crimson/osd/osd_operations/background_recovery.cc index c030c9d89708..7f93e42d53d8 100644 --- a/src/crimson/osd/osd_operations/background_recovery.cc +++ b/src/crimson/osd/osd_operations/background_recovery.cc @@ -175,41 +175,7 @@ PglogBasedRecovery::do_recovery() }); } -PGPeeringPipeline &BackfillRecovery::peering_pp(PG &pg) -{ - return pg.peering_request_pg_pipeline; -} - -BackfillRecovery::interruptible_future -BackfillRecovery::do_recovery() -{ - LOG_PREFIX(BackfillRecovery::do_recovery); - DEBUGDPPI("{}", *pg, __func__); - - if (pg->has_reset_since(epoch_started)) { - DEBUGDPPI("{}: pg got reset since epoch_started={}", - *pg, __func__, epoch_started); - return seastar::make_ready_future(false); - } - // TODO: limits - return enter_stage( - // process_event() of our boost::statechart machine is non-reentrant. - // with the backfill_pipeline we protect it from a second entry from - // the implementation of BackfillListener. - // additionally, this stage serves to synchronize with PeeringEvent. - peering_pp(*pg).process - ).then_interruptible([this] { - pg->get_recovery_handler()->dispatch_backfill_event(std::move(evt)); - return handle.complete(); - }).then_interruptible([] { - return seastar::make_ready_future(false); - }).finally([this] { - handle.exit(); - }); -} - template class BackgroundRecoveryT; template class BackgroundRecoveryT; -template class BackgroundRecoveryT; } // namespace crimson::osd diff --git a/src/crimson/osd/osd_operations/background_recovery.h b/src/crimson/osd/osd_operations/background_recovery.h index 5ae0e1a9edb8..255a934cd498 100644 --- a/src/crimson/osd/osd_operations/background_recovery.h +++ b/src/crimson/osd/osd_operations/background_recovery.h @@ -52,10 +52,9 @@ private: /// represent a recovery initiated for serving a client request /// -/// unlike @c PglogBasedRecovery and @c BackfillRecovery, -/// @c UrgentRecovery is not throttled by the scheduler. and it -/// utilizes @c RecoveryBackend directly to recover the unreadable -/// object. +/// unlike @c PglogBasedRecovery, @c UrgentRecovery is not throttled +/// by the scheduler. and it utilizes @c RecoveryBackend directly to +/// recover the unreadable object. class UrgentRecovery final : public BackgroundRecoveryT { public: UrgentRecovery( @@ -107,49 +106,9 @@ private: bool cancelled = false; }; -class BackfillRecovery final : public BackgroundRecoveryT { -public: - - template - BackfillRecovery( - Ref pg, - ShardServices &ss, - epoch_t epoch_started, - const EventT& evt); - - PipelineHandle& get_handle() { return handle; } - - std::tuple< - OperationThrottler::BlockingEvent, - PGPeeringPipeline::Process::BlockingEvent - > tracking_events; - -private: - boost::intrusive_ptr evt; - PipelineHandle handle; - - static PGPeeringPipeline &peering_pp(PG &pg); - interruptible_future do_recovery() override; -}; - -template -BackfillRecovery::BackfillRecovery( - Ref pg, - ShardServices &ss, - const epoch_t epoch_started, - const EventT& evt) - : BackgroundRecoveryT( - std::move(pg), - ss, - epoch_started, - crimson::osd::scheduler::scheduler_class_t::background_best_effort), - evt(evt.intrusive_from_this()) -{} - } #if FMT_VERSION >= 90000 -template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template <> struct fmt::formatter : fmt::ostream_formatter {}; template struct fmt::formatter> : fmt::ostream_formatter {}; diff --git a/src/crimson/osd/osd_operations/peering_event.h b/src/crimson/osd/osd_operations/peering_event.h index aa6b8a95a94a..9b8723b1c147 100644 --- a/src/crimson/osd/osd_operations/peering_event.h +++ b/src/crimson/osd/osd_operations/peering_event.h @@ -21,7 +21,6 @@ namespace crimson::osd { class OSD; class ShardServices; class PG; -class BackfillRecovery; template class PeeringEvent : public PhasedOperationT { diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index df19ee92b3a8..2684599d0993 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -64,7 +64,6 @@ namespace crimson::os { namespace crimson::osd { class OpsExecuter; -class BackfillRecovery; class SnapTrimEvent; class PglogBasedRecovery; @@ -892,7 +891,6 @@ private: friend class RepRequest; friend class LogMissingRequest; friend class LogMissingRequestReply; - friend class BackfillRecovery; friend struct PGFacade; friend class InternalClientRequest; friend class WatchTimeoutRequest; diff --git a/src/crimson/osd/pg_recovery.cc b/src/crimson/osd/pg_recovery.cc index 76aac5010ce5..12c35586fc7f 100644 --- a/src/crimson/osd/pg_recovery.cc +++ b/src/crimson/osd/pg_recovery.cc @@ -639,8 +639,6 @@ void PGRecovery::backfilled() void PGRecovery::backfill_suspended() { - // We are not creating a new BackfillRecovery request here, as we - // need to cancel the backfill synchronously (before this method returns). using BackfillState = crimson::osd::BackfillState; backfill_state->process_event( BackfillState::SuspendBackfill{}.intrusive_from_this());