]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDSRank: Add set_history_slow_op_size_and_threshold for op_tracker 53358/head
authoryite.gu <yitegu0@gmail.com>
Thu, 15 Jun 2023 11:41:53 +0000 (19:41 +0800)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sun, 10 Sep 2023 08:33:14 +0000 (15:33 +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 90c5df4a101057066ecaa2ae96717983aab443c2..e4330f05637d7617cdb86a3669449cfc1757e847 100644 (file)
@@ -1156,6 +1156,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 03a78cc32211038090f1b4d102f628b6ea53dad1..2fff631cf41a5f89f3029dbcf8e60a6531ced3b9 100644 (file)
@@ -550,6 +550,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();
 }
@@ -3795,6 +3797,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);
   }