]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDSRank: Add set_history_slow_op_size_and_threshold for op_tracker 53357/head
authoryite.gu <yitegu0@gmail.com>
Thu, 15 Jun 2023 11:41:53 +0000 (19:41 +0800)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Tue, 28 Nov 2023 12:26:21 +0000 (19:26 +0700)
void OpHistory::_insert_delayed(const utime_t& now, TrackedOpRef op)
{
...
  double opduration = op->get_duration();
...
  if (opduration >= history_slow_op_threshold.load()) {
    slow_op.insert(make_pair(op->get_initiated(), op));
    logger->inc(l_trackedop_slow_op_count);
  }
...
}
mds op_tracker have no set slow op threshold, and history_slow_op_threshold default
value is 0, cause to mds have slow op alway.

Fixes: https://tracker.ceph.com/issues/61749
Signed-off-by: Yite Gu <yitegu0@gmail.com>
(cherry picked from commit 9b88a4759b1559c16f9874e9a9493573ec799be8)

src/common/options/mds.yaml.in
src/mds/MDSRank.cc

index 6eb0702fcdda183ec516ee65d6a2d7c0c9632831..ac74a883b90d3d81101d19bca579ad73b418cb61 100644 (file)
@@ -1175,6 +1175,24 @@ options:
   services:
   - mds
   with_legacy: true
+# Max number of slow ops to track
+- name: mds_op_history_slow_op_size
+  type: uint
+  level: advanced
+  desc: maximum size for list of historical slow operations
+  default: 20
+  services:
+  - mds
+  with_legacy: true
+# Track the op if over this threshold
+- name: mds_op_history_slow_op_threshold
+  type: uint
+  level: advanced
+  desc: track the op if over this threshold
+  default: 10
+  services:
+  - mds
+  with_legacy: true
 # how many seconds old makes an op complaint-worthy
 - name: mds_op_complaint_time
   type: float
index 9a80534a4d588a21b63d38b047a7b5822f7fbeec..166d640ff0486fa3131b732bc43acea14b8b3d65 100644 (file)
@@ -551,6 +551,8 @@ MDSRank::MDSRank(
                                          cct->_conf->mds_op_log_threshold);
   op_tracker.set_history_size_and_duration(cct->_conf->mds_op_history_size,
                                            cct->_conf->mds_op_history_duration);
+  op_tracker.set_history_slow_op_size_and_threshold(cct->_conf->mds_op_history_slow_op_size,
+                                                    cct->_conf->mds_op_history_slow_op_threshold);
 
   schedule_update_timer_task();
 }
@@ -3842,6 +3844,9 @@ void MDSRankDispatcher::handle_conf_change(const ConfigProxy& conf, const std::s
   if (changed.count("mds_op_history_size") || changed.count("mds_op_history_duration")) {
     op_tracker.set_history_size_and_duration(conf->mds_op_history_size, conf->mds_op_history_duration);
   }
+  if (changed.count("mds_op_history_slow_op_size") || changed.count("mds_op_history_slow_op_threshold")) {
+    op_tracker.set_history_slow_op_size_and_threshold(conf->mds_op_history_slow_op_size, conf->mds_op_history_slow_op_threshold);
+  }
   if (changed.count("mds_enable_op_tracker")) {
     op_tracker.set_tracking(conf->mds_enable_op_tracker);
   }