From 943e9024f608943271b2455912d099c147c3997e Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Thu, 27 Jun 2024 18:23:21 +0800 Subject: [PATCH] crimson/osd/osd_operations/client_request: merge recover_missing, recover_missing_lock_obc and recover_missing_snaps into a single OrderedConcurrentPhase The reasons for this change are as follows: 1. the pipeline phase in which the obc loading is done has to be entered "synchronouly", however, the leaving of an OrderedConcurrentPhase can't be so, which means we can't enter_sync an OrderedConcurrentPhase from an earlier OrderedConcurrentPhase directly; 2. on the other hand, the whole missing object/snaps recovery procedure can and should be a OrderedConcurrentPhase. Signed-off-by: Xuehan Xu --- .../osd/osd_operation_external_tracking.h | 38 ------------------- .../osd/osd_operations/client_request.cc | 10 +---- .../osd/osd_operations/client_request.h | 8 ---- 3 files changed, 2 insertions(+), 54 deletions(-) diff --git a/src/crimson/osd/osd_operation_external_tracking.h b/src/crimson/osd/osd_operation_external_tracking.h index 2f05d70a8bd..5d3bba58db0 100644 --- a/src/crimson/osd/osd_operation_external_tracking.h +++ b/src/crimson/osd/osd_operation_external_tracking.h @@ -35,10 +35,6 @@ struct LttngBackend ClientRequest::PGPipeline::RecoverMissing::BlockingEvent::Backend, ClientRequest::PGPipeline::RecoverMissing:: BlockingEvent::ExitBarrierEvent::Backend, - ClientRequest::PGPipeline::RecoverMissingLockOBC::BlockingEvent::Backend, - ClientRequest::PGPipeline::RecoverMissingLockOBC:: - BlockingEvent::ExitBarrierEvent::Backend, - ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent::Backend, ClientRequest::PGPipeline::GetOBC::BlockingEvent::Backend, ClientRequest::PGPipeline::LockOBC::BlockingEvent::Backend, ClientRequest::PGPipeline::LockOBC::BlockingEvent::ExitBarrierEvent::Backend, @@ -115,21 +111,6 @@ struct LttngBackend const Operation& op) override { } - void handle(ClientRequest::PGPipeline::RecoverMissingLockOBC::BlockingEvent& ev, - const Operation& op, - const ClientRequest::PGPipeline::RecoverMissingLockOBC& blocker) override { - } - - void handle(ClientRequest::PGPipeline::RecoverMissingLockOBC:: - BlockingEvent::ExitBarrierEvent& ev, - const Operation& op) override { - } - - void handle(ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent& ev, - const Operation& op, - const ClientRequest::PGPipeline::RecoverMissingSnaps& blocker) override { - } - void handle(ClientRequest::PGPipeline::GetOBC::BlockingEvent& ev, const Operation& op, const ClientRequest::PGPipeline::GetOBC& blocker) override { @@ -183,10 +164,6 @@ struct HistoricBackend ClientRequest::PGPipeline::RecoverMissing::BlockingEvent::Backend, ClientRequest::PGPipeline::RecoverMissing:: BlockingEvent::ExitBarrierEvent::Backend, - ClientRequest::PGPipeline::RecoverMissingLockOBC::BlockingEvent::Backend, - ClientRequest::PGPipeline::RecoverMissingLockOBC:: - BlockingEvent::ExitBarrierEvent::Backend, - ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent::Backend, ClientRequest::PGPipeline::GetOBC::BlockingEvent::Backend, ClientRequest::PGPipeline::LockOBC::BlockingEvent::Backend, ClientRequest::PGPipeline::LockOBC::BlockingEvent::ExitBarrierEvent::Backend, @@ -263,21 +240,6 @@ struct HistoricBackend const Operation& op) override { } - void handle(ClientRequest::PGPipeline::RecoverMissingLockOBC::BlockingEvent& ev, - const Operation& op, - const ClientRequest::PGPipeline::RecoverMissingLockOBC& blocker) override { - } - - void handle(ClientRequest::PGPipeline::RecoverMissingLockOBC:: - BlockingEvent::ExitBarrierEvent& ev, - const Operation& op) override { - } - - void handle(ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent& ev, - const Operation& op, - const ClientRequest::PGPipeline::RecoverMissingSnaps& blocker) override { - } - void handle(ClientRequest::PGPipeline::GetOBC::BlockingEvent& ev, const Operation& op, const ClientRequest::PGPipeline::GetOBC& blocker) override { diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index bb314bad4f3..4c359410871 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -294,9 +294,7 @@ ClientRequest::recover_missing_snaps( ObjectContextRef head, std::set &snaps) { - LOG_PREFIX(ClientRequest::process_op); - co_await ihref.enter_stage( - client_pp(*pg).recover_missing_snaps, *this); + LOG_PREFIX(ClientRequest::recover_missing_snaps); for (auto &snap : snaps) { auto coid = head->obs.oi.soid; coid.snap = snap; @@ -323,9 +321,7 @@ ClientRequest::process_op( instance_handle_t &ihref, Ref pg, unsigned this_instance_id) { LOG_PREFIX(ClientRequest::process_op); - co_await ihref.enter_stage( - client_pp(*pg).recover_missing, *this - ); + ihref.enter_stage_sync(client_pp(*pg).recover_missing, *this); if (!pg->is_primary()) { DEBUGDPP( "Skipping recover_missings on non primary pg for soid {}", @@ -342,8 +338,6 @@ ClientRequest::process_op( std::set snaps = snaps_need_to_recover(); if (!snaps.empty()) { // call with_obc() in order, but wait concurrently for loading. - ihref.enter_stage_sync( - client_pp(*pg).recover_missing_lock_obc, *this); auto with_obc = pg->obc_loader.with_obc( m->get_hobj().get_head(), [&snaps, &ihref, pg, this](auto head, auto) { diff --git a/src/crimson/osd/osd_operations/client_request.h b/src/crimson/osd/osd_operations/client_request.h index e4284ba90d0..c5ab670c78b 100644 --- a/src/crimson/osd/osd_operations/client_request.h +++ b/src/crimson/osd/osd_operations/client_request.h @@ -44,12 +44,6 @@ class ClientRequest final : public PhasedOperationT, public: class PGPipeline : public CommonPGPipeline { public: - struct RecoverMissingLockOBC : OrderedConcurrentPhaseT { - static constexpr auto type_name = "ClientRequest::PGPipeline::recover_missing_lock_obc"; - } recover_missing_lock_obc; - struct RecoverMissingSnaps : OrderedExclusivePhaseT { - static constexpr auto type_name = "ClientRequest::PGPipeline::recover_missing_snaps"; - } recover_missing_snaps; struct AwaitMap : OrderedExclusivePhaseT { static constexpr auto type_name = "ClientRequest::PGPipeline::await_map"; } await_map; @@ -108,8 +102,6 @@ public: PGPipeline::WaitForActive::BlockingEvent, PGActivationBlocker::BlockingEvent, PGPipeline::RecoverMissing::BlockingEvent, - PGPipeline::RecoverMissingLockOBC::BlockingEvent, - PGPipeline::RecoverMissingSnaps::BlockingEvent, scrub::PGScrubber::BlockingEvent, PGPipeline::GetOBC::BlockingEvent, PGPipeline::LockOBC::BlockingEvent, -- 2.39.5