]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: introduce WaitSubop stage to SnapTrimEvent
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 6 Dec 2022 14:04:17 +0000 (14:04 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 28 Feb 2023 16:22:05 +0000 (16:22 +0000)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/osd_operations/snaptrim_event.cc
src/crimson/osd/osd_operations/snaptrim_event.h

index 933ad6dcc5a613ba61e7741e17159054eeb16444..816e06e44a6d305f49eda0f02c19bb77b64c6741 100644 (file)
@@ -151,9 +151,15 @@ seastar::future<seastar::stop_iteration> SnapTrimEvent::with_pg(
             snapid);
           subop_blocker.emplace_back(op->get_id(), std::move(fut));
         }
-        return subop_blocker.wait_completion().then([] {
-          return seastar::make_ready_future<seastar::stop_iteration>(
-            seastar::stop_iteration::no);
+        return enter_stage<interruptor>(
+          wait_subop
+        ).then_interruptible([this] {
+          logger().debug("{}: awaiting completion", *this);
+          return subop_blocker.wait_completion().then([this] {
+            logger().debug("{}: all completed", *this);
+            return interruptor::make_ready_future<seastar::stop_iteration>(
+              seastar::stop_iteration::no);
+          });
         });
       });
     });
index 4ec54af66a39034e453592bdf5ef3aee047eaaca..7f5d2e5910df0aecbca5b96aef7a4c9c1edc682a 100644 (file)
@@ -61,6 +61,13 @@ private:
   private:
     std::vector<id_done_t> subops;
   } subop_blocker;
+
+  // we don't need to synchronize with other instances of SnapTrimEvent;
+  // it's here for the sake of op tracking.
+  struct WaitSubop : OrderedConcurrentPhaseT<WaitSubop> {
+    static constexpr auto type_name = "SnapTrimEvent::wait_subop";
+  } wait_subop;
+
   PipelineHandle handle;
   Ref<PG> pg;
   SnapMapper& snap_mapper;
@@ -76,6 +83,7 @@ public:
     CommonPGPipeline::RecoverMissing::BlockingEvent,
     CommonPGPipeline::GetOBC::BlockingEvent,
     CommonPGPipeline::Process::BlockingEvent,
+    WaitSubop::BlockingEvent,
     CompletionEvent
   > tracking_events;
 };