From e94a12a8e3dde07114400485acf0dbc77cd19431 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 1 Aug 2022 23:20:02 +0000 Subject: [PATCH] crimson/osd: modify start_pg_operation to return op_id The op will actually be run generally on a different core, so we don't want to be returning a reference to it. Signed-off-by: Samuel Just --- src/crimson/common/operation.h | 7 ++++--- .../osd/osd_operations/compound_peering_request.cc | 10 +++++----- .../osd/osd_operations/compound_peering_request.h | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/crimson/common/operation.h b/src/crimson/common/operation.h index e079502cbf5..6a6a48a2fd9 100644 --- a/src/crimson/common/operation.h +++ b/src/crimson/common/operation.h @@ -310,7 +310,8 @@ private: class Operation : public boost::intrusive_ref_counter< Operation, boost::thread_unsafe_counter> { public: - uint64_t get_id() const { + using id_t = uint64_t; + id_t get_id() const { return id; } @@ -327,8 +328,8 @@ class Operation : public boost::intrusive_ref_counter< registry_hook_t registry_hook; - uint64_t id = 0; - void set_id(uint64_t in_id) { + id_t id = 0; + void set_id(id_t in_id) { id = in_id; } diff --git a/src/crimson/osd/osd_operations/compound_peering_request.cc b/src/crimson/osd/osd_operations/compound_peering_request.cc index 5b32454c40f..a30b03b1a01 100644 --- a/src/crimson/osd/osd_operations/compound_peering_request.cc +++ b/src/crimson/osd/osd_operations/compound_peering_request.cc @@ -60,13 +60,13 @@ public: } }; -std::vector handle_pg_create( +std::vector handle_pg_create( PGShardManager &pg_shard_manager, crimson::net::ConnectionRef conn, compound_state_ref state, Ref m) { - std::vector ret; + std::vector ret; for (auto& [pgid, when] : m->pgs) { const auto &[created, created_stamp] = when; auto q = m->pg_extra.find(pgid); @@ -85,7 +85,7 @@ std::vector handle_pg_create( pgid, m->epoch, pi, history); } else { - auto op = pg_shard_manager.start_pg_operation( + auto [op_id, fut] = pg_shard_manager.start_pg_operation( state, conn, pg_shard_t(), @@ -94,8 +94,8 @@ std::vector handle_pg_create( m->epoch, NullEvt(), true, - new PGCreateInfo(pgid, m->epoch, history, pi, true)).first; - ret.push_back(op); + new PGCreateInfo(pgid, m->epoch, history, pi, true)); + ret.push_back(op_id); } } return ret; diff --git a/src/crimson/osd/osd_operations/compound_peering_request.h b/src/crimson/osd/osd_operations/compound_peering_request.h index 4e45de82353..4fbc3ffb278 100644 --- a/src/crimson/osd/osd_operations/compound_peering_request.h +++ b/src/crimson/osd/osd_operations/compound_peering_request.h @@ -27,15 +27,15 @@ public: struct SubOpBlocker : crimson::BlockerT { static constexpr const char * type_name = "CompoundOpBlocker"; - std::vector subops; - SubOpBlocker(std::vector &&subops) + std::vector subops; + SubOpBlocker(std::vector &&subops) : subops(subops) {} virtual void dump_detail(Formatter *f) const { f->open_array_section("dependent_operations"); { for (auto &i : subops) { - i->dump_brief(f); + f->dump_unsigned("op_id", i); } } f->close_section(); -- 2.39.5