]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/admin/osd_admin: DumpInFlightOpsHook to await active
authorMatan Breizman <mbreizma@redhat.com>
Wed, 28 May 2025 10:49:13 +0000 (10:49 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Mon, 23 Jun 2025 10:38:48 +0000 (10:38 +0000)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/admin/osd_admin.cc
src/crimson/osd/pg_shard_manager.h

index 870be14b6c7b645e8f84fef30f0c129cb68b310e..28a1c5234b97fbcea300da7fad1e336ea1cbf0b7 100644 (file)
@@ -578,12 +578,15 @@ public:
     auto *f = fref.get();
     f->open_object_section("ops_in_flight");
     f->open_array_section("ops_in_flight");
-    return pg_shard_manager.invoke_on_each_shard_seq([f](const auto &shard_services) {
-      return shard_services.dump_ops_in_flight(f);
-    }).then([fref=std::move(fref)]() mutable {
-      fref->close_section();
-      fref->close_section();
-      return seastar::make_ready_future<tell_result_t>(std::move(fref));
+    return pg_shard_manager.when_active()
+    .then([this, f, fref=std::move(fref)]() mutable {
+      return pg_shard_manager.invoke_on_each_shard_seq([f](const auto &shard_services) {
+        return shard_services.dump_ops_in_flight(f);
+      }).then([fref=std::move(fref)]() mutable {
+        fref->close_section();
+        fref->close_section();
+        return seastar::make_ready_future<tell_result_t>(std::move(fref));
+      });
     });
   }
 private:
index d492b0184afa475f94eaa4f5d564496913508037..b9aa7c631818621f00eb9e53cdd854896769abac 100644 (file)
@@ -121,7 +121,7 @@ public:
   FORWARD(set_booting, set_booting, get_shard_services().local_state.osd_state)
   FORWARD(set_stopping, set_stopping, get_shard_services().local_state.osd_state)
   FORWARD(set_active, set_active, get_shard_services().local_state.osd_state)
-  FORWARD(when_active, when_active, get_shard_services().local_state.osd_state)
+  FORWARD_CONST(when_active, when_active, get_shard_services().local_state.osd_state)
   FORWARD_CONST(get_osd_state_string, to_string, get_shard_services().local_state.osd_state)
 
   FORWARD(got_map, got_map, get_shard_services().local_state.osdmap_gate)