From: yite.gu Date: Thu, 15 Jun 2023 11:41:53 +0000 (+0800) Subject: mds/MDSRank: Add set_history_slow_op_size_and_threshold for op_tracker X-Git-Tag: v19.0.0~889^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9b88a4759b1559c16f9874e9a9493573ec799be8;p=ceph.git mds/MDSRank: Add set_history_slow_op_size_and_threshold for op_tracker 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 --- diff --git a/src/common/options/mds.yaml.in b/src/common/options/mds.yaml.in index f21d5faf381..5d059e6dc81 100644 --- a/src/common/options/mds.yaml.in +++ b/src/common/options/mds.yaml.in @@ -1166,6 +1166,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 diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 6ebbd880c64..cc4701ce707 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -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(); } @@ -3849,6 +3851,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); }