From: Samuel Just Date: Thu, 8 Sep 2022 19:43:42 +0000 (-0700) Subject: crimson/osd/osd_operations/client_request: remove OSD reference X-Git-Tag: v18.1.0~1115^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5f2c40d0c80abc5c8724184fa4f6956666501d45;p=ceph.git crimson/osd/osd_operations/client_request: remove OSD reference Capture ShardServices reference for use in put_historic directly. Signed-off-by: Samuel Just --- diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 7ebe89f4d31e..795a040a8bec 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -1012,7 +1012,7 @@ seastar::future<> OSD::handle_osd_op(crimson::net::ConnectionRef conn, Ref m) { (void) pg_shard_manager.start_pg_operation( - *this, + get_shard_services(), conn, std::move(m)); return seastar::now(); diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index d19e5a97ee23..e23c4aeeddfc 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -49,8 +49,9 @@ void ClientRequest::complete_request() } ClientRequest::ClientRequest( - OSD &osd, crimson::net::ConnectionRef conn, Ref &&m) - : osd(osd), + ShardServices &shard_services, crimson::net::ConnectionRef conn, + Ref &&m) + : put_historic_shard_services(&shard_services), conn(std::move(conn)), m(std::move(m)), instance_handle(new instance_handle_t) @@ -173,6 +174,7 @@ seastar::future<> ClientRequest::with_pg_int( seastar::future<> ClientRequest::with_pg( ShardServices &shard_services, Ref pgref) { + put_historic_shard_services = &shard_services; pgref->client_request_orderer.add_request(*this); auto ret = on_complete.get_future(); std::ignore = with_pg_int( @@ -347,7 +349,8 @@ bool ClientRequest::is_misdirected(const PG& pg) const void ClientRequest::put_historic() const { - osd.get_shard_services().get_registry().put_historic(*this); + ceph_assert_always(put_historic_shard_services); + put_historic_shard_services->get_registry().put_historic(*this); } } diff --git a/src/crimson/osd/osd_operations/client_request.h b/src/crimson/osd/osd_operations/client_request.h index fafcc5165320..27bab52f522e 100644 --- a/src/crimson/osd/osd_operations/client_request.h +++ b/src/crimson/osd/osd_operations/client_request.h @@ -28,9 +28,11 @@ class ShardServices; class ClientRequest final : public PhasedOperationT, private CommonClientRequest { - OSD &osd; - crimson::net::ConnectionFRef conn; + // Initially set to primary core, updated to pg core after move, + // used by put_historic + ShardServices *put_historic_shard_services = nullptr; + crimson::net::ConnectionFRef conn; // must be after conn due to ConnectionPipeline's life-time Ref m; OpInfo op_info; @@ -184,7 +186,9 @@ public: static constexpr OperationTypeCode type = OperationTypeCode::client_request; - ClientRequest(OSD &osd, crimson::net::ConnectionRef, Ref &&m); + ClientRequest( + ShardServices &shard_services, + crimson::net::ConnectionRef, Ref &&m); ~ClientRequest(); void print(std::ostream &) const final;