]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/.../replicated_request: factor out with_pg_interruptible
authorSamuel Just <sjust@redhat.com>
Fri, 13 Dec 2024 21:36:59 +0000 (21:36 +0000)
committerSamuel Just <sjust@redhat.com>
Tue, 17 Dec 2024 17:14:28 +0000 (09:14 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/osd_operations/replicated_request.cc
src/crimson/osd/osd_operations/replicated_request.h

index 5e173cf1d516af48918dea5858db7df917575933..c8b2bdd381695478b9e2010f41bc7fa72956963e 100644 (file)
@@ -63,6 +63,24 @@ PGRepopPipeline &RepRequest::repop_pipeline(PG &pg)
   return pg.repop_pipeline;
 }
 
+RepRequest::interruptible_future<> RepRequest::with_pg_interruptible(
+  Ref<PG> pg)
+{
+  LOG_PREFIX(RepRequest::with_pg_interruptible);
+  DEBUGI("{}", *this);
+  return this->template enter_stage<interruptor>(repop_pipeline(*pg).process
+  ).then_interruptible([this, pg] {
+    return this->template with_blocking_event<
+      PG_OSDMapGate::OSDMapBlocker::BlockingEvent
+      >([this, pg](auto &&trigger) {
+        return pg->osdmap_gate.wait_for_map(
+          std::move(trigger), req->min_epoch);
+      });
+  }).then_interruptible([this, pg] (auto) {
+    return pg->handle_rep_op(req);
+  });
+}
+
 seastar::future<> RepRequest::with_pg(
   ShardServices &shard_services, Ref<PG> pg)
 {
@@ -70,19 +88,7 @@ seastar::future<> RepRequest::with_pg(
   DEBUGI("{}", *this);
   IRef ref = this;
   return interruptor::with_interruption([this, pg] {
-    LOG_PREFIX(RepRequest::with_pg);
-    DEBUGI("{}: pg present", *this);
-    return this->template enter_stage<interruptor>(repop_pipeline(*pg).process
-    ).then_interruptible([this, pg] {
-      return this->template with_blocking_event<
-        PG_OSDMapGate::OSDMapBlocker::BlockingEvent
-      >([this, pg](auto &&trigger) {
-        return pg->osdmap_gate.wait_for_map(
-          std::move(trigger), req->min_epoch);
-      });
-    }).then_interruptible([this, pg] (auto) {
-      return pg->handle_rep_op(req);
-    });
+    return with_pg_interruptible(pg);
   }, [](std::exception_ptr) {
     return seastar::now();
   }, pg, pg->get_osdmap_epoch()).finally([this, ref=std::move(ref)] {
index 1e84fd108e23e1e83dd88093a50959dbdd8a362e..3609a51e96f311c50f26fdf00017ca897795afd6 100644 (file)
@@ -68,6 +68,9 @@ public:
     r_conn = make_local_shared_foreign(std::move(conn));
   }
 
+  interruptible_future<> with_pg_interruptible(
+    Ref<PG> pg);
+
   seastar::future<> with_pg(
     ShardServices &shard_services, Ref<PG> pg);