template std::unique_ptr<AdminSocketHook>
make_asok_hook<DumpSlowestHistoricOpsHook>(const crimson::osd::OSDOperationRegistry& op_registry);
+class DumpRecoveryReservationsHook : public AdminSocketHook {
+public:
+ explicit DumpRecoveryReservationsHook(crimson::osd::ShardServices& shard_services) :
+ AdminSocketHook{"dump_recovery_reservations", "", "show recovery reservations"},
+ shard_services(shard_services)
+ {}
+ seastar::future<tell_result_t> call(const cmdmap_t&,
+ std::string_view format,
+ ceph::bufferlist&& input) const final
+ {
+ logger().debug("{}", __func__);
+ unique_ptr<Formatter> f{Formatter::create(format, "json-pretty", "json-pretty")};
+ return seastar::do_with(std::move(f), [this](auto&& f) {
+ f->open_object_section("reservations");
+ f->open_object_section("local_reservations");
+ return shard_services.local_dump_reservations(f.get()).then([&f, this] {
+ f->close_section();
+ f->open_object_section("remote_reservations");
+ return shard_services.remote_dump_reservations(f.get()).then([&f] {
+ f->close_section();
+ f->close_section();
+ return seastar::make_ready_future<tell_result_t>(std::move(f));
+ });
+ });
+ });
+ }
+private:
+ crimson::osd::ShardServices& shard_services;
+};
+template std::unique_ptr<AdminSocketHook>
+make_asok_hook<DumpRecoveryReservationsHook>(crimson::osd::ShardServices& shard_services);
+
} // namespace crimson::admin
class DumpInFlightOpsHook;
class DumpHistoricOpsHook;
class DumpSlowestHistoricOpsHook;
+class DumpRecoveryReservationsHook;
template<class Hook, class... Args>
std::unique_ptr<AdminSocketHook> make_asok_hook(Args&&... args);
FORWARD_TO_OSD_SINGLETON_TARGET(
local_cancel_reservation,
local_reserver.cancel_reservation)
+ FORWARD_TO_OSD_SINGLETON_TARGET(
+ local_dump_reservations,
+ local_reserver.dump)
FORWARD_TO_OSD_SINGLETON_TARGET(
remote_cancel_reservation,
remote_reserver.cancel_reservation)
+ FORWARD_TO_OSD_SINGLETON_TARGET(
+ remote_dump_reservations,
+ remote_reserver.dump)
Context *invoke_context_on_core(core_id_t core, Context *c) {
if (!c) return nullptr;