diff options
author | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2022-12-06 15:04:17 +0100 |
---|---|---|
committer | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2023-02-28 17:22:05 +0100 |
commit | 6df8e3965cdf54aab05bf4ff3cb011d017e0a550 (patch) | |
tree | fe4139fe69e140eb904257ac3a014218fdd59f92 /src | |
parent | crimson/osd: snap trimming informs OpsExecuter about altered objects (diff) | |
download | ceph-6df8e3965cdf54aab05bf4ff3cb011d017e0a550.tar.xz ceph-6df8e3965cdf54aab05bf4ff3cb011d017e0a550.zip |
crimson/osd: introduce WaitSubop stage to SnapTrimEvent
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/crimson/osd/osd_operations/snaptrim_event.cc | 12 | ||||
-rw-r--r-- | src/crimson/osd/osd_operations/snaptrim_event.h | 8 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/crimson/osd/osd_operations/snaptrim_event.cc b/src/crimson/osd/osd_operations/snaptrim_event.cc index 933ad6dcc5a..816e06e44a6 100644 --- a/src/crimson/osd/osd_operations/snaptrim_event.cc +++ b/src/crimson/osd/osd_operations/snaptrim_event.cc @@ -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); + }); }); }); }); diff --git a/src/crimson/osd/osd_operations/snaptrim_event.h b/src/crimson/osd/osd_operations/snaptrim_event.h index 4ec54af66a3..7f5d2e5910d 100644 --- a/src/crimson/osd/osd_operations/snaptrim_event.h +++ b/src/crimson/osd/osd_operations/snaptrim_event.h @@ -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; }; |