From: Sage Weil Date: Wed, 2 Jul 2014 05:04:50 +0000 (-0700) Subject: osd: add dump_reservations asok command X-Git-Tag: v0.84~149^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2059%2Fhead;p=ceph.git osd: add dump_reservations asok command Allow an admin to inspect pending and in-progress reservations. Backport: firefly Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index d3b496f69a6c..bb35139ca7bf 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1119,6 +1119,15 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format, } f->close_section(); //watches + } else if (command == "dump_reservations") { + f->open_object_section("reservations"); + f->open_object_section("local_reservations"); + service.local_reserver.dump(f); + f->close_section(); + f->open_object_section("remote_reservations"); + service.remote_reserver.dump(f); + f->close_section(); + f->close_section(); } else { assert(0 == "broken asok registration"); } @@ -1375,6 +1384,10 @@ void OSD::final_init() "show clients which have active watches," " and on which objects"); assert(r == 0); + r = admin_socket->register_command("dump_reservations", "dump_reservations", + asok_hook, + "show recovery reservations"); + assert(r == 0); test_ops_hook = new TestOpsSocketHook(&(this->service), this->store); // Note: pools are CephString instead of CephPoolname because @@ -1656,6 +1669,7 @@ int OSD::shutdown() cct->get_admin_socket()->unregister_command("dump_op_pq_state"); cct->get_admin_socket()->unregister_command("dump_blacklist"); cct->get_admin_socket()->unregister_command("dump_watchers"); + cct->get_admin_socket()->unregister_command("dump_reservations"); delete asok_hook; asok_hook = NULL;