Skip to content

Commit 2ef46b4

Browse files
committed
crimson/admin/osd_admin: DumpInFlightOpsHook to await active
Signed-off-by: Matan Breizman <[email protected]>
1 parent 47c922c commit 2ef46b4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/crimson/admin/osd_admin.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,15 @@ class DumpInFlightOpsHook : public AdminSocketHook {
578578
auto *f = fref.get();
579579
f->open_object_section("ops_in_flight");
580580
f->open_array_section("ops_in_flight");
581-
return pg_shard_manager.invoke_on_each_shard_seq([f](const auto &shard_services) {
582-
return shard_services.dump_ops_in_flight(f);
583-
}).then([fref=std::move(fref)]() mutable {
584-
fref->close_section();
585-
fref->close_section();
586-
return seastar::make_ready_future<tell_result_t>(std::move(fref));
581+
return pg_shard_manager.when_active()
582+
.then([this, f, fref=std::move(fref)]() mutable {
583+
return pg_shard_manager.invoke_on_each_shard_seq([f](const auto &shard_services) {
584+
return shard_services.dump_ops_in_flight(f);
585+
}).then([fref=std::move(fref)]() mutable {
586+
fref->close_section();
587+
fref->close_section();
588+
return seastar::make_ready_future<tell_result_t>(std::move(fref));
589+
});
587590
});
588591
}
589592
private:

src/crimson/osd/pg_shard_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class PGShardManager {
121121
FORWARD(set_booting, set_booting, get_shard_services().local_state.osd_state)
122122
FORWARD(set_stopping, set_stopping, get_shard_services().local_state.osd_state)
123123
FORWARD(set_active, set_active, get_shard_services().local_state.osd_state)
124-
FORWARD(when_active, when_active, get_shard_services().local_state.osd_state)
124+
FORWARD_CONST(when_active, when_active, get_shard_services().local_state.osd_state)
125125
FORWARD_CONST(get_osd_state_string, to_string, get_shard_services().local_state.osd_state)
126126

127127
FORWARD(got_map, got_map, get_shard_services().local_state.osdmap_gate)

0 commit comments

Comments
 (0)