]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add 'send_beacon' tell/asok command(s)
authorSage Weil <sage@redhat.com>
Fri, 1 Mar 2019 21:47:17 +0000 (15:47 -0600)
committerSage Weil <sage@redhat.com>
Sun, 3 Mar 2019 16:23:27 +0000 (10:23 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 2b9830232a4eb814dcfd5587775c3a2456a39b3e..41b5a4ee315f0e498aafebf44196ecdd67599f9e 100644 (file)
@@ -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;
   }