]> git.apps.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>
Fri, 18 Oct 2019 17:53:45 +0000 (10:53 -0700)
Fixes: https://tracker.ceph.com/issues/41689
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 6d2e4cb109caff8dae5e5e18563b6305131b488b)

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 d85a581958af449de4e3798804538f30895c5b68..e52b5d533642b7e5c80fa2d725dd432dd622db96 100644 (file)
@@ -1468,7 +1468,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 100eb6a46446faaf6c781636f03cbaf101d1e6ec..5b7d5948ef2f9f3186db36c7bc081c27a9a0511f 100644 (file)
@@ -214,7 +214,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 2a1cab15bf1aad439c0c3e421476c15872a0b243..0db450a9b33439f36b9066cbb5d28656387748fe 100644 (file)
@@ -2582,7 +2582,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 beab62e6bb40a3f05d23f548c36399308385191e..61db02ec095b926a6a59f2a4d6fd4acdf123861c 100644 (file)
@@ -2301,7 +2301,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");