]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Add debug_heartbeat_testing_span to allow quicker testing
authorDavid Zafman <dzafman@redhat.com>
Wed, 24 Jul 2019 21:19:43 +0000 (14:19 -0700)
committerDavid Zafman <dzafman@redhat.com>
Fri, 18 Oct 2019 17:49:41 +0000 (10:49 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 573aea2bb1d48237df5182a6e4421e15c1eea88c)

src/common/options.cc
src/osd/OSD.cc
src/osd/OSD.h

index 3a35947e52d9ff59c24b84d164d5ff6635e0784d..315f47d861768440a7f2a374051300ddea3e73b3 100644 (file)
@@ -5008,6 +5008,10 @@ std::vector<Option> get_global_options() {
     Option("debug_disable_randomized_ping", Option::TYPE_BOOL, Option::LEVEL_DEV)
     .set_default(false)
     .set_description("Disable heartbeat ping randomization for testing purposes"),
+
+    Option("debug_heartbeat_testing_span", Option::TYPE_INT, Option::LEVEL_DEV)
+    .set_default(0)
+    .set_description("Override 60 second periods for testing only"),
   });
 }
 
index f6edeb39185aab9cacbd399fb19c7702ee694268..321de0189c6067a121f69d34b522c59bc01c5ab6 100644 (file)
@@ -4813,7 +4813,11 @@ void OSD::handle_osd_ping(MOSDPing *m)
            ceph_assert(i->second.hb_interval_start != utime_t());
            if (i->second.hb_interval_start == utime_t())
              i->second.hb_interval_start = now;
-           if (now - i->second.hb_interval_start >=  utime_t(hb_avg, 0)) {
+           int64_t hb_avg_time_period = 60;
+           if (cct->_conf.get_val<int64_t>("debug_heartbeat_testing_span")) {
+             hb_avg_time_period = cct->_conf.get_val<int64_t>("debug_heartbeat_testing_span");
+           }
+           if (now - i->second.hb_interval_start >=  utime_t(hb_avg_time_period, 0)) {
               uint32_t back_avg = i->second.hb_total_back / i->second.hb_average_count;
               uint32_t back_min = i->second.hb_min_back;
               uint32_t back_max = i->second.hb_max_back;
index 900c9cdd0efed794d331204c926bd9c2a6068a9b..81eabebc74d66d1fdf327395bc721a931a21d40a 100644 (file)
@@ -1581,7 +1581,6 @@ private:
   utime_t last_heartbeat_resample;   ///< last time we chose random peers in waiting-for-healthy state
   double daily_loadavg;
 
-  const uint32_t hb_avg = 60;
   // Track ping repsonse times using vector as a circular buffer
   // MUST BE A POWER OF 2
   const uint32_t hb_vector_size = 16;