]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add flush_journal admin socket command
authorIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 18 Mar 2014 16:06:12 +0000 (18:06 +0200)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Wed, 19 Mar 2014 08:59:26 +0000 (10:59 +0200)
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>
src/osd/OSD.cc

index 60a54a620b91a8ae6fe69553f19aff9303c856d2..db14031f730de5c93eda703cdb66df658c2a3f83 100644 (file)
@@ -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");