]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: add mds_heartbeat_reset_grace option support
authorXiubo Li <xiubli@redhat.com>
Tue, 22 Feb 2022 07:03:35 +0000 (15:03 +0800)
committerXiubo Li <xiubli@redhat.com>
Thu, 24 Feb 2022 11:59:00 +0000 (19:59 +0800)
Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/common/options/mds.yaml.in
src/mds/MDSRank.cc
src/mds/MDSRank.h

index 5036a4665ef1edf7091a2842dd5a028a853fea48..c6a648053a0bcde5d2cfb45871d969858ed2afe7 100644 (file)
@@ -206,6 +206,14 @@ options:
   services:
   - mds
   with_legacy: true
+- name: mds_heartbeat_reset_grace
+  type: uint
+  level: advanced
+  desc: the basic unit of tolerance in how many circles in a loop, which will
+    keep running by holding the mds_lock, it must trigger to reset heartbeat
+  default: 1000
+  services:
+  - mds
 - name: mds_heartbeat_grace
   type: float
   level: advanced
index 053799c0df077b24eb983f9b82445804c40e29a4..b9e5bf6e4fceee015098aafefc63218fbf870c34 100644 (file)
@@ -543,6 +543,7 @@ MDSRank::MDSRank(
   server = new Server(this, &metrics_handler);
   locker = new Locker(this, mdcache);
 
+  _heartbeat_reset_grace = g_conf().get_val<uint64_t>("mds_heartbeat_reset_grace");
   heartbeat_grace = g_conf().get_val<double>("mds_heartbeat_grace");
   op_tracker.set_complaint_and_threshold(cct->_conf->mds_op_complaint_time,
                                          cct->_conf->mds_op_log_threshold);
@@ -3751,6 +3752,7 @@ const char** MDSRankDispatcher::get_tracked_conf_keys() const
     "mds_recall_warning_decay_rate",
     "mds_request_load_average_decay_rate",
     "mds_session_cache_liveness_decay_rate",
+    "mds_heartbeat_reset_grace",
     "mds_heartbeat_grace",
     "mds_session_cap_acquisition_decay_rate",
     "mds_max_caps_per_client",
@@ -3769,6 +3771,9 @@ void MDSRankDispatcher::handle_conf_change(const ConfigProxy& conf, const std::s
 {
   // XXX with or without mds_lock!
 
+  if (changed.count("mds_heartbeat_reset_grace")) {
+    _heartbeat_reset_grace = conf.get_val<uint64_t>("mds_heartbeat_reset_grace");
+  }
   if (changed.count("mds_heartbeat_grace")) {
     heartbeat_grace = conf.get_val<double>("mds_heartbeat_grace");
   }
index 3df1abb5d13a78d81ffebc96d6697f65e3267047..20d7aa5c53414a1a2d7fecbea439909a9d321032 100644 (file)
@@ -267,6 +267,9 @@ class MDSRank {
      * of code while holding the mds_lock
      */
     void heartbeat_reset();
+    int heartbeat_reset_grace(int count=1) {
+      return count * _heartbeat_reset_grace;
+    }
 
     /**
      * Report state DAMAGED to the mon, and then pass on to respawn().  Call
@@ -576,6 +579,7 @@ class MDSRank {
 
     ceph::heartbeat_handle_d *hb = nullptr;  // Heartbeat for threads using mds_lock
     double heartbeat_grace;
+    int _heartbeat_reset_grace;
 
     std::map<mds_rank_t, version_t> peer_mdsmap_epoch;