]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add dump_reservations asok command 2059/head
authorSage Weil <sage@inktank.com>
Wed, 2 Jul 2014 05:04:50 +0000 (22:04 -0700)
committerSage Weil <sage@inktank.com>
Wed, 2 Jul 2014 05:04:50 +0000 (22:04 -0700)
Allow an admin to inspect pending and in-progress reservations.

Backport: firefly
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSD.cc

index d3b496f69a6c9bada7fd4f1f8338175a75750f80..bb35139ca7bfaa042f0cec5a062fbc2989b78515 100644 (file)
@@ -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;