]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: specialize messages to use the external connection 51707/head
authorYingxin Cheng <yingxin.cheng@intel.com>
Mon, 3 Apr 2023 08:39:52 +0000 (16:39 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 23 May 2023 13:20:51 +0000 (13:20 +0000)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
(cherry picked from commit ebda4900736dfe4ee38163ae7adcc7d06d07e3a9)

src/crimson/osd/osd.cc
src/messages/MOSDOp.h
src/messages/MOSDPGNotify2.h
src/messages/MOSDPeeringOp.h

index 6ec72bf69337fa09af4ff0df33a5dff1c4a035d4..25a271e970af109f6a28b60b50164d6b4132f0b0 100644 (file)
@@ -1226,6 +1226,7 @@ seastar::future<> OSD::handle_peering_op(
 {
   const int from = m->get_source().num();
   logger().debug("handle_peering_op on {} from {}", m->get_spg(), from);
+  m->set_features(conn->get_features());
   std::unique_ptr<PGPeeringEvent> evt(m->get_event());
   (void) pg_shard_manager.start_pg_operation<RemotePeeringEvent>(
     conn,
index 2275c458832299dd0097cf9a45405888e803cf23..97432d1186b117d412eb912d955eda42242482a1 100644 (file)
@@ -166,6 +166,10 @@ public:
   uint64_t get_features() const {
     if (features)
       return features;
+#ifdef WITH_SEASTAR
+    // In crimson, conn is independently maintained outside Message.
+    ceph_abort();
+#endif
     return get_connection()->get_features();
   }
 
index 1270373985587850e45faff4ccd3a49d353acdca..ae17edae50f23d204b98ce2890c2d6c1840e287b 100644 (file)
@@ -33,7 +33,12 @@ public:
        spgid,
        pg_shard_t(get_source().num(), notify.from),
        notify,
-       get_connection()->get_features()),
+#ifdef WITH_SEASTAR
+       features
+#else
+       get_connection()->get_features()
+#endif
+      ),
       true,
       new PGCreateInfo(
        spgid,
index 56d10cff1362949be41870df67b105fda7e2feec..bfb0380260c1e3a24505c6b66f32785316a34f69 100644 (file)
@@ -25,4 +25,16 @@ public:
   virtual epoch_t get_min_epoch() const = 0;
   virtual PGPeeringEvent *get_event() = 0;
   virtual void inner_print(std::ostream& out) const = 0;
+
+#ifdef WITH_SEASTAR
+  // In crimson, conn is independently maintained outside Message.
+  // Instead of get features from the connection later, set features at
+  // the start of the operation.
+  void set_features(uint64_t _features) {
+    features = _features;
+  }
+
+protected:
+  uint64_t features;
+#endif
 };