diff options
author | Ilya Dryomov <ilya.dryomov@inktank.com> | 2014-03-18 18:06:12 +0200 |
---|---|---|
committer | Ilya Dryomov <ilya.dryomov@inktank.com> | 2014-03-19 10:59:26 +0200 |
commit | 9d31c1be1f9538fe9a89d5936a89cf46f2c4599a (patch) | |
tree | 80d05edb265a33f51b4a4767f01f259f750eb656 | |
parent | 76beb5ce82d6e7c6bd6dd3b7f844851ad67db18d (diff) | |
download | ceph-9d31c1be1f9538fe9a89d5936a89cf46f2c4599a.tar.gz |
osd: add flush_journal admin socket command
Add flush_journal admin socket command to be able to flush journal to
the permanent store for online osds. (For offline osds we already have
ceph-osd --flush-journal.)
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
-rw-r--r-- | src/osd/OSD.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 60a54a620b9..db14031f730 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1009,6 +1009,8 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format, f->dump_unsigned("num_pgs", pg_map.size()); osd_lock.Unlock(); f->close_section(); + } else if (command == "flush_journal") { + store->sync_and_flush(); } else if (command == "dump_ops_in_flight") { op_tracker.dump_ops_in_flight(f); } else if (command == "dump_historic_ops") { @@ -1297,6 +1299,10 @@ void OSD::final_init() r = admin_socket->register_command("status", "status", asok_hook, "high-level status of OSD"); assert(r == 0); + r = admin_socket->register_command("flush_journal", "flush_journal", + asok_hook, + "flush the journal to permanent store"); + assert(r == 0); r = admin_socket->register_command("dump_ops_in_flight", "dump_ops_in_flight", asok_hook, "show the ops currently in flight"); @@ -1590,6 +1596,7 @@ int OSD::shutdown() // unregister commands cct->get_admin_socket()->unregister_command("status"); + cct->get_admin_socket()->unregister_command("flush_journal"); cct->get_admin_socket()->unregister_command("dump_ops_in_flight"); cct->get_admin_socket()->unregister_command("dump_historic_ops"); cct->get_admin_socket()->unregister_command("dump_op_pq_state"); |