From 6bcd631101b808bd4ce1222c0ff6cadf3738d4ae Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 1 Mar 2019 15:47:17 -0600 Subject: [PATCH] osd: add 'send_beacon' tell/asok command(s) Signed-off-by: Sage Weil --- src/osd/OSD.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 2b9830232a4..41b5a4ee315 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2699,6 +2699,10 @@ will start to track new ops received afterwards."; f->dump_string("device", "/dev/" + dev); } f->close_section(); + } else if (admin_command == "send_beacon") { + if (is_active()) { + send_beacon(ceph::coarse_mono_clock::now()); + } } else { ceph_abort_msg("broken asok registration"); } @@ -3360,6 +3364,9 @@ void OSD::final_init() r = admin_socket->register_command("list_devices", "list_devices", asok_hook, "list OSD devices."); + r = admin_socket->register_command("send_beacon", "send_beacon", + asok_hook, + "send OSD beacon to mon immediately"); test_ops_hook = new TestOpsSocketHook(&(this->service), this->store); // Note: pools are CephString instead of CephPoolname because @@ -6433,6 +6440,9 @@ COMMAND("cache drop", COMMAND("cache status", "Get OSD caches statistics", "osd", "r") +COMMAND("send_beacon", + "Send OSD beacon to mon immediately", + "osd", "r") }; void OSD::do_command( @@ -6958,8 +6968,11 @@ int OSD::_do_command( store->dump_cache_stats(ds); } } - - else { + else if (prefix == "send_beacon") { + if (is_active()) { + send_beacon(ceph::coarse_mono_clock::now()); + } + } else { ss << "unrecognized command '" << prefix << "'"; r = -EINVAL; } -- 2.39.5