]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg: Use ObjectContextLoader::notify_on_change()
authorMatan Breizman <mbreizma@redhat.com>
Tue, 8 Nov 2022 09:43:32 +0000 (09:43 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 22 Nov 2022 09:35:38 +0000 (09:35 +0000)
obc_set_accessing is owned by ObjectContextLoader and is
removed from PG.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/object_context_loader.cc
src/crimson/osd/object_context_loader.h
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index 246c20fcfe518ab5aab7077119cb918364b67fc1..81edc3c74a8eb3a9162de631dfaac3900d4b7165 100644 (file)
@@ -155,6 +155,13 @@ using crimson::common::local_conf;
     });
   }
 
+  void ObjectContextLoader::notify_on_change(bool is_primary)
+  {
+    for (auto& obc : obc_set_accessing) {
+      obc.interrupt(::crimson::common::actingset_changed(is_primary));
+    }
+  }
+
   // explicitly instantiate the used instantiations
   template ObjectContextLoader::load_obc_iertr::future<>
   ObjectContextLoader::with_head_obc<RWState::RWNONE>(hobject_t,
index 7771da3cde405145d8c70d925b63f067432a0d4e..7c572229ac924757b9c164aadb3f5b0cb831b1bf 100644 (file)
@@ -54,6 +54,8 @@ public:
 
   load_obc_iertr::future<> reload_obc(ObjectContext& obc) const;
 
+  void notify_on_change(bool is_primary);
+
 private:
   ShardServices &shard_services;
   PGBackend* backend;
index b8420ef3f4e01ee9a2c3cc4bf59d9a332927bb9a..e554bd7d9bc3f66837d66b25822120d677fde9a1 100644 (file)
@@ -1238,9 +1238,7 @@ seastar::future<> PG::stop()
 
 void PG::on_change(ceph::os::Transaction &t) {
   logger().debug("{} {}:", *this, __func__);
-  for (auto& obc : obc_set_accessing) {
-    obc.interrupt(::crimson::common::actingset_changed(is_primary()));
-  }
+  obc_loader.notify_on_change(is_primary());
   recovery_backend->on_peering_interval_change(t);
   backend->on_actingset_changed({ is_primary() });
   wait_for_active_blocker.unblock();
index 000844aa271ad939941e4f9b1f01e13374c71313..56235b73b35ff913835e71ebce399bb3ad3db74c 100644 (file)
@@ -524,11 +524,6 @@ public:
   using with_obc_func_t =
     std::function<load_obc_iertr::future<> (ObjectContextRef)>;
 
-  using obc_accessing_list_t = boost::intrusive::list<
-    ObjectContext,
-    ObjectContext::obc_accessing_option_t>;
-  obc_accessing_list_t obc_set_accessing;
-
   load_obc_iertr::future<> with_locked_obc(
     const hobject_t &hobj,
     const OpInfo &op_info,