]> 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>
Wed, 4 Sep 2019 17:13:32 +0000 (17:13 +0000)
Signed-off-by: David Zafman <dzafman@redhat.com>
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 9c7a3b302949f52df4e01b1913d0a397e4280542..71aa7e232bf3596f55c9c2578892f5589e3417c7 100644 (file)
   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 c88df3ea832ebc5701e74905ef92ad2e1fbdf26d..b167a8e1aef11c2980fef52d55db8dc1c25501af 100644 (file)
@@ -407,7 +407,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 48ad67ed06189f88bb5bfd49cc134dc024f72cc1..07dc193f3e9cbce8a1cc36c42df00525bf6a610e 100644 (file)
@@ -1712,13 +1712,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 80eb6828a8dcc86a44a7c27b42002c00bcfcbafa..1571d81efe7afc7b95ef12930086073d2b5be6aa 100644 (file)
@@ -223,12 +223,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;
@@ -321,7 +325,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 2b7f1f6d17a38682e3c1575e1a1289fe745c7c15..f6365a5a03bbb63c8671c21e37ba8e33d5dee48a 100644 (file)
@@ -2762,7 +2762,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 84eba7408880c34e5ba28c9f0daa1b8230579c3c..a0a4ff778e8f87efb21e20b4c2be8149a3f4382a 100644 (file)
@@ -2567,12 +2567,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;
 
@@ -2650,7 +2654,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);