]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/osd_operations/client_request: merge recover_missing,
authorXuehan Xu <xuxuehan@qianxin.com>
Thu, 27 Jun 2024 10:23:21 +0000 (18:23 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Wed, 7 Aug 2024 11:18:48 +0000 (19:18 +0800)
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 <xuxuehan@qianxin.com>
src/crimson/osd/osd_operation_external_tracking.h
src/crimson/osd/osd_operations/client_request.cc
src/crimson/osd/osd_operations/client_request.h

index 2f05d70a8bde2037b9607207cd5d5ec676cdda12..5d3bba58db0c2f6e3bd832145898fb33d4a3fb5f 100644 (file)
@@ -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 {
index bb314bad4f39d46463083cb4da208081e6bf4e48..4c3594108717a97468594f958123bac89df62e1e 100644 (file)
@@ -294,9 +294,7 @@ ClientRequest::recover_missing_snaps(
   ObjectContextRef head,
   std::set<snapid_t> &snaps)
 {
-  LOG_PREFIX(ClientRequest::process_op);
-  co_await ihref.enter_stage<interruptor>(
-    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> pg, unsigned this_instance_id)
 {
   LOG_PREFIX(ClientRequest::process_op);
-  co_await ihref.enter_stage<interruptor>(
-    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<snapid_t> 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<RWState::RWREAD>(
         m->get_hobj().get_head(),
         [&snaps, &ihref, pg, this](auto head, auto) {
index e4284ba90d0d53bb85bacf38c20bb9e67c4037d8..c5ab670c78bd34dd5d1628d10bfd392816490052 100644 (file)
@@ -44,12 +44,6 @@ class ClientRequest final : public PhasedOperationT<ClientRequest>,
 public:
   class PGPipeline : public CommonPGPipeline {
     public:
-    struct RecoverMissingLockOBC : OrderedConcurrentPhaseT<RecoverMissingLockOBC> {
-      static constexpr auto type_name = "ClientRequest::PGPipeline::recover_missing_lock_obc";
-    } recover_missing_lock_obc;
-    struct RecoverMissingSnaps : OrderedExclusivePhaseT<RecoverMissingSnaps> {
-      static constexpr auto type_name = "ClientRequest::PGPipeline::recover_missing_snaps";
-    } recover_missing_snaps;
     struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
       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,