Skip to content

Commit

Permalink
mds/MDSRank: Add set_history_slow_op_size_and_threshold for op_tracker
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YiteGu committed Jun 20, 2023
1 parent 3fbfd18 commit 9b88a47
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/common/options/mds.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/mds/MDSRank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 9b88a47

Please sign in to comment.