]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: fix DynamicPerfStats usage in ClientRequest
authorSamuel Just <sjust@redhat.com>
Sat, 5 Apr 2025 01:57:33 +0000 (18:57 -0700)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 30 Apr 2025 08:22:09 +0000 (08:22 +0000)
ClientRequest::get_connection() return l_conn, which will be
null by the time PG::add_client_request_lat is called in
ClientRequest::do_process.  Modify get_connection() to
return a Connection& from whichever of l_conn or r_conn
isn't null.

Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 794bb024efa94cb2bb2a90df226bab05c8b9449b)

src/crimson/osd/osd_operations/client_request.h
src/osd/DynamicPerfStats.h

index bdc3ff0d241597424f86845663d46fb589e76b2e..d8865235aeae19d498c87cb852f3ba284c8d67d2 100644 (file)
@@ -54,8 +54,13 @@ public:
     static_assert(std::is_same_v<T, MOSDOp>);
     return m.get();
   }
-  const crimson::net::ConnectionRef &get_connection() const {
-    return l_conn;
+  const crimson::net::Connection &get_connection() const {
+    if (l_conn) {
+      return *l_conn;
+    } else {
+      assert(r_conn);
+      return *r_conn;
+    }
   }
 
   /**
index 996baabb498e3cec45e6be0f2894ec7474b5e623..4277973514e604a8472643544069bb163f7310c7 100644 (file)
@@ -122,7 +122,7 @@ public:
             break;
           case OSDPerfMetricSubKeyType::CLIENT_ADDRESS:
 #ifdef WITH_CRIMSON
-           match_string = stringify(op.get_connection()->get_peer_addr());
+           match_string = stringify(op.get_connection().get_peer_addr());
 #else
             match_string = stringify(m->get_connection()->get_peer_addr());
 #endif