]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd doc mon mgr: To milliseconds for config value, user input and threshold out
authorDavid Zafman <dzafman@redhat.com>
Wed, 4 Sep 2019 17:13:32 +0000 (17:13 +0000)
committerDavid Zafman <dzafman@redhat.com>
Fri, 18 Oct 2019 17:52:02 +0000 (10:52 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 5f83a6158b29944cf8f5a069c50edba3e172cdcc)

Conflicts:
src/common/options.cc (trivial)

PendingReleaseNotes
doc/rados/configuration/mon-config-ref.rst
qa/standalone/misc/network-ping.sh
src/common/options.cc
src/mgr/ClusterState.cc
src/mon/PGMap.cc
src/osd/OSD.cc

index a20f36098f8b8bc140fdd5dda1b3e91aee106f51..a9c0e8dc260a9b8b6a86885a98638e3bfcd5f821 100644 (file)
@@ -17,7 +17,7 @@
   option ``mon_warn_on_slow_ping_ratio`` specifies a percentage of
   ``osd_heartbeat_grace`` to determine the threshold.  A value of zero
   disables the warning.  New configuration option
- ``mon_warn_on_slow_ping_time`` specified in microseconds over-rides the
+ ``mon_warn_on_slow_ping_time`` specified in milliseconds over-rides the
   computed value, causes a warning
   when OSD heartbeat pings take longer than the specified amount.
   New admin command ``ceph daemon mgr.# dump_osd_network [threshold]`` command will
index a84f459585f4e6e0f7e92b48ef02bee5d6f08e69..01432c3f352576f7a81ae4d99cfebc146ec7b873 100644 (file)
@@ -409,7 +409,7 @@ by setting it in the ``[mon]`` section of the configuration file.
 :Description: Override ``mon warn on slow ping ratio`` with a specific value.
               Issue a ``HEALTH_WARN`` in cluster log if any heartbeat
               between OSDs exceeds ``mon warn on slow ping time``
-              microseconds.  The default is 0 (disabled).
+              milliseconds.  The default is 0 (disabled).
 :Type: Integer
 :Default: ``0``
 
index 5ddbd1241bd0612f9ef7f8d1aea7380432e664a9..15f2e68dabe44888274edae2a678462a44744b28 100755 (executable)
@@ -43,11 +43,11 @@ function TEST_network_ping_test1() {
 
     CEPH_ARGS='' ceph daemon $(get_asok_path osd.0) dump_osd_network | tee $dir/json
     test "$(cat $dir/json | jq '.entries | length')" = "0" || return 1
-    test "$(cat $dir/json | jq '.threshold')" = "1000000" || return 1
+    test "$(cat $dir/json | jq '.threshold')" = "1000" || return 1
 
     CEPH_ARGS='' ceph daemon $(get_asok_path mgr.x) dump_osd_network | tee $dir/json
     test "$(cat $dir/json | jq '.entries | length')" = "0" || return 1
-    test "$(cat $dir/json | jq '.threshold')" = "1000000" || return 1
+    test "$(cat $dir/json | jq '.threshold')" = "1000" || return 1
 
     CEPH_ARGS='' ceph daemon $(get_asok_path osd.0) dump_osd_network 0 | tee $dir/json
     test "$(cat $dir/json | jq '.entries | length')" = "4" || return 1
@@ -62,11 +62,11 @@ function TEST_network_ping_test1() {
     flush_pg_stats
     CEPH_ARGS='' ceph daemon $(get_asok_path osd.0) dump_osd_network | tee $dir/json
     test "$(cat $dir/json | jq '.entries | length')" = "0" || return 1
-    test "$(cat $dir/json | jq '.threshold')" = "1000000" || return 1
+    test "$(cat $dir/json | jq '.threshold')" = "1000" || return 1
 
     CEPH_ARGS='' ceph daemon $(get_asok_path mgr.x) dump_osd_network | tee $dir/json
     test "$(cat $dir/json | jq '.entries | length')" = "0" || return 1
-    test "$(cat $dir/json | jq '.threshold')" = "1000000" || return 1
+    test "$(cat $dir/json | jq '.threshold')" = "1000" || return 1
 
     CEPH_ARGS='' ceph daemon $(get_asok_path osd.0) dump_osd_network 0 | tee $dir/json
     test "$(cat $dir/json | jq '.entries | length')" = "4" || return 1
@@ -82,11 +82,11 @@ function TEST_network_ping_test1() {
     flush_pg_stats
     CEPH_ARGS='' ceph daemon $(get_asok_path osd.0) dump_osd_network | tee $dir/json
     test "$(cat $dir/json | jq '.entries | length')" = "0" || return 1
-    test "$(cat $dir/json | jq '.threshold')" = "1000000" || return 1
+    test "$(cat $dir/json | jq '.threshold')" = "1000" || return 1
 
     CEPH_ARGS='' ceph daemon $(get_asok_path mgr.x) dump_osd_network | tee $dir/json
     test "$(cat $dir/json | jq '.entries | length')" = "0" || return 1
-    test "$(cat $dir/json | jq '.threshold')" = "1000000" || return 1
+    test "$(cat $dir/json | jq '.threshold')" = "1000" || return 1
 
     CEPH_ARGS='' ceph daemon $(get_asok_path osd.0) dump_osd_network 0 | tee $dir/json
     test "$(cat $dir/json | jq '.entries | length')" = "4" || return 1
@@ -96,6 +96,12 @@ function TEST_network_ping_test1() {
     test "$(cat $dir/json | jq '.entries | length')" = "12" || return 1
     test "$(cat $dir/json | jq '.threshold')" = "0" || return 1
 
+    # Just check the threshold output matches the input
+    CEPH_ARGS='' ceph daemon $(get_asok_path mgr.x) dump_osd_network 99 | tee $dir/json
+    test "$(cat $dir/json | jq '.threshold')" = "99" || return 1
+    CEPH_ARGS='' ceph daemon $(get_asok_path osd.0) dump_osd_network 98 | tee $dir/json
+    test "$(cat $dir/json | jq '.threshold')" = "98" || return 1
+
     rm -f $dir/json
 }
 
index 315f47d861768440a7f2a374051300ddea3e73b3..d85a581958af449de4e3798804538f30895c5b68 100644 (file)
@@ -1468,13 +1468,13 @@ std::vector<Option> get_global_options() {
     .add_service("mgr")
     .set_description("Issue a health warning if there are fewer OSDs than osd_pool_default_size"),
 
-    Option("mon_warn_on_slow_ping_time", Option::TYPE_UINT, Option::LEVEL_BASIC)
+    Option("mon_warn_on_slow_ping_time", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(0)
     .add_service("mgr")
-    .set_description("Override mon_warn_on_slow_ping_ratio with specified threshold in microseconds")
+    .set_description("Override mon_warn_on_slow_ping_ratio with specified threshold in milliseconds")
     .add_see_also("mon_warn_on_slow_ping_ratio"),
 
-    Option("mon_warn_on_slow_ping_ratio", Option::TYPE_FLOAT, Option::LEVEL_BASIC)
+    Option("mon_warn_on_slow_ping_ratio", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
     .set_default(.05)
     .add_service("mgr")
     .set_description("Issue a health warning if heartbeat ping longer than percentage of osd_heartbeat_grace")
index c8082ad102c8f23594f83b6cd5b7d85cf64f6115..100eb6a46446faaf6c781636f03cbaf101d1e6ec 100644 (file)
@@ -213,12 +213,16 @@ bool ClusterState::asok_command(std::string_view admin_command, const cmdmap_t&
     int64_t value = 0;
     // Default to health warning level if nothing specified
     if (!(cmd_getval(g_ceph_context, cmdmap, "value", value))) {
-      value = static_cast<int64_t>(g_ceph_context->_conf.get_val<uint64_t>("mon_warn_on_slow_ping_time"));
+      // Convert milliseconds to microseconds
+      value = static_cast<int64_t>(g_ceph_context->_conf.get_val<uint64_t>("mon_warn_on_slow_ping_time")) * 1000;
       if (value == 0) {
         double ratio = g_conf().get_val<double>("mon_warn_on_slow_ping_ratio");
        value = g_conf().get_val<int64_t>("osd_heartbeat_grace");
        value *= 1000000 * ratio; // Seconds of grace to microseconds at ratio
       }
+    } else {
+      // Convert user input to microseconds
+      value *= 1000;
     }
     if (value < 0)
       value = 0;
@@ -311,7 +315,7 @@ bool ClusterState::asok_command(std::string_view admin_command, const cmdmap_t&
 
     // Network ping times (1min 5min 15min)
     f->open_object_section("network_ping_times");
-    f->dump_int("threshold", value);
+    f->dump_int("threshold", value / 1000);
     f->open_array_section("entries");
     for (auto &sitem : boost::adaptors::reverse(sorted)) {
       ceph_assert(!value || sitem.pingtime >= value);
index 45f741e097931595398af1a9adafe2578a4611d2..2a1cab15bf1aad439c0c3e421476c15872a0b243 100644 (file)
@@ -2581,7 +2581,8 @@ void PGMap::get_health_checks(
   }
 
   // SLOW_PING_TIME
-  auto warn_slow_ping_time = cct->_conf.get_val<uint64_t>("mon_warn_on_slow_ping_time");
+  // Convert milliseconds to microseconds
+  auto warn_slow_ping_time = cct->_conf.get_val<uint64_t>("mon_warn_on_slow_ping_time") * 1000;
   auto grace = cct->_conf.get_val<int64_t>("osd_heartbeat_grace");
   if (warn_slow_ping_time == 0) {
     double ratio = cct->_conf.get_val<double>("mon_warn_on_slow_ping_ratio");
index e7e068474e6d47a8b18329526336881e56e9eb1c..beab62e6bb40a3f05d23f548c36399308385191e 100644 (file)
@@ -2300,12 +2300,16 @@ will start to track new ops received afterwards.";
   } else if (admin_command == "dump_osd_network") {
     int64_t value = 0;
     if (!(cmd_getval(cct, cmdmap, "value", value))) {
-      value = static_cast<int64_t>(g_conf().get_val<uint64_t>("mon_warn_on_slow_ping_time"));
+      // Convert milliseconds to microseconds
+      value = static_cast<int64_t>(g_conf().get_val<uint64_t>("mon_warn_on_slow_ping_time")) * 1000;
       if (value == 0) {
         double ratio = g_conf().get_val<double>("mon_warn_on_slow_ping_ratio");
         value = g_conf().get_val<int64_t>("osd_heartbeat_grace");
         value *= 1000000 * ratio; // Seconds of grace to microseconds at ratio
       }
+    } else {
+      // Convert user input to microseconds
+      value *= 1000;
     }
     if (value < 0) value = 0;
 
@@ -2383,7 +2387,7 @@ will start to track new ops received afterwards.";
     //
     // Network ping times (1min 5min 15min)
     f->open_object_section("network_ping_times");
-    f->dump_int("threshold", value);
+    f->dump_int("threshold", value / 1000);
     f->open_array_section("entries");
     for (auto &sitem : boost::adaptors::reverse(sorted)) {
       ceph_assert(sitem.pingtime >= value);