Skip to content

Commit

Permalink
osd: add flush_journal admin socket command
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
idryomov committed Mar 19, 2014
1 parent 76beb5c commit 9d31c1b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 9d31c1b

Please sign in to comment.