]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Allow fractional milliseconds to make test possible
authorDavid Zafman <dzafman@redhat.com>
Fri, 6 Sep 2019 18:20:10 +0000 (11:20 -0700)
committerDavid Zafman <dzafman@redhat.com>
Mon, 4 Nov 2019 22:23:29 +0000 (14:23 -0800)
Fixes: https://tracker.ceph.com/issues/41689
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 6d2e4cb109caff8dae5e5e18563b6305131b488b)

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

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 05bbcd25cf5e01e64290bd0baffc050d466e87cd..217944c85deb328bb2618a7d796aae2a2037ed55 100644 (file)
@@ -1732,7 +1732,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 5ef19327c70e543b1aa501eb2128a56b422a283a..891bd562a51fadae638af1ccc2ffafb49a09a042 100644 (file)
@@ -225,7 +225,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 fe88a68d373e56545bdfa714c7bfa33fac21d2a9..5e5e26ba758f9a3112f367e0d03d3cf0280df718 100644 (file)
@@ -2713,7 +2713,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 b9756bb34bc8105c1c424c726d600b1fe4235796..07dc18a69275fc2e4cc6992429de117588b5454b 100644 (file)
@@ -2732,7 +2732,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");