]> 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>
Mon, 4 Nov 2019 22:22:48 +0000 (14:22 -0800)
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 aa3c36ef59802045897be9704d7997efe16dd870..cb764db5aaa0c1522ca273df76f619a6d7c3d99a 100644 (file)
@@ -32,7 +32,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 2b541d022d76834e3c3243d2070868fcb0a6f9ed..2b48ad81c0b12fc17b8f396521fdf89c99f15153 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 97e01243d31c2ccc03d314dca157720edef743f7..05bbcd25cf5e01e64290bd0baffc050d466e87cd 100644 (file)
@@ -1732,13 +1732,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 5c1adccada923c1b3351d1e391affa5de41a7a70..5ef19327c70e543b1aa501eb2128a56b422a283a 100644 (file)
@@ -224,12 +224,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;
@@ -322,7 +326,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 f1ac5d4dc647c5149d1ad29f34a3d646726b4750..fe88a68d373e56545bdfa714c7bfa33fac21d2a9 100644 (file)
@@ -2712,7 +2712,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 237d6824b5437c8fb041e617caa54293ab9a9add..b9756bb34bc8105c1c424c726d600b1fe4235796 100644 (file)
@@ -2731,12 +2731,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;
 
@@ -2814,7 +2818,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);