]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Allow fractional milliseconds to make test possible 30220/head
authorDavid Zafman <dzafman@redhat.com>
Fri, 6 Sep 2019 18:20:10 +0000 (11:20 -0700)
committerDavid Zafman <dzafman@redhat.com>
Fri, 6 Sep 2019 18:23:52 +0000 (11:23 -0700)
Fixes: https://tracker.ceph.com/issues/41689
Signed-off-by: David Zafman <dzafman@redhat.com>
qa/standalone/misc/network-ping.sh
src/common/options.cc
src/mgr/ClusterState.cc
src/mon/PGMap.cc
src/osd/OSD.cc

index 15f2e68dabe44888274edae2a678462a44744b28..b2b299d63ee81e28c9edff11e3fbcaf4eb556591 100755 (executable)
@@ -111,7 +111,7 @@ function TEST_network_ping_test2() {
     local dir=$1
 
     export CEPH_ARGS
-    export EXTRA_OPTS=" --mon_warn_on_slow_ping_time=1"
+    export EXTRA_OPTS=" --mon_warn_on_slow_ping_time=0.001"
     run_mon $dir a || return 1
     run_mgr $dir x || return 1
     run_osd $dir 0 || return 1
index 2c6ac9a8674cd47243984174e7440f000194a647..7968cb70058a2282b6819b36ebfe22432637426b 100644 (file)
@@ -1712,7 +1712,7 @@ 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_ADVANCED)
+    Option("mon_warn_on_slow_ping_time", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
     .set_default(0)
     .add_service("mgr")
     .set_description("Override mon_warn_on_slow_ping_ratio with specified threshold in milliseconds")
index 1571d81efe7afc7b95ef12930086073d2b5be6aa..55bd0e1cbc8a392099b8a933c61843cb40fde49f 100644 (file)
@@ -224,7 +224,7 @@ bool ClusterState::asok_command(std::string_view admin_command, const cmdmap_t&
     // Default to health warning level if nothing specified
     if (!(cmd_getval(g_ceph_context, cmdmap, "value", value))) {
       // Convert milliseconds to microseconds
-      value = static_cast<int64_t>(g_ceph_context->_conf.get_val<uint64_t>("mon_warn_on_slow_ping_time")) * 1000;
+      value = static_cast<int64_t>(g_ceph_context->_conf.get_val<double>("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");
index f6365a5a03bbb63c8671c21e37ba8e33d5dee48a..2eced47be1080fdbd4003f938f2aa5c4da14a6ba 100644 (file)
@@ -2763,7 +2763,7 @@ void PGMap::get_health_checks(
 
   // 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 warn_slow_ping_time = cct->_conf.get_val<double>("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 7f2275255678c9d583f7653b403b600fe7e98ae3..ba5a60bd190d7a39f8245cec301fdbe1f9317f76 100644 (file)
@@ -2580,7 +2580,7 @@ will start to track new ops received afterwards.";
     int64_t value = 0;
     if (!(cmd_getval(cct, cmdmap, "value", value))) {
       // Convert milliseconds to microseconds
-      value = static_cast<int64_t>(g_conf().get_val<uint64_t>("mon_warn_on_slow_ping_time")) * 1000;
+      value = static_cast<int64_t>(g_conf().get_val<double>("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");