Skip to content

Commit 9b88a47

Browse files
committed
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 <[email protected]>
1 parent 3fbfd18 commit 9b88a47

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/common/options/mds.yaml.in

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,24 @@ options:
11661166
services:
11671167
- mds
11681168
with_legacy: true
1169+
# Max number of slow ops to track
1170+
- name: mds_op_history_slow_op_size
1171+
type: uint
1172+
level: advanced
1173+
desc: maximum size for list of historical slow operations
1174+
default: 20
1175+
services:
1176+
- mds
1177+
with_legacy: true
1178+
# Track the op if over this threshold
1179+
- name: mds_op_history_slow_op_threshold
1180+
type: uint
1181+
level: advanced
1182+
desc: track the op if over this threshold
1183+
default: 10
1184+
services:
1185+
- mds
1186+
with_legacy: true
11691187
# how many seconds old makes an op complaint-worthy
11701188
- name: mds_op_complaint_time
11711189
type: float

src/mds/MDSRank.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ MDSRank::MDSRank(
550550
cct->_conf->mds_op_log_threshold);
551551
op_tracker.set_history_size_and_duration(cct->_conf->mds_op_history_size,
552552
cct->_conf->mds_op_history_duration);
553+
op_tracker.set_history_slow_op_size_and_threshold(cct->_conf->mds_op_history_slow_op_size,
554+
cct->_conf->mds_op_history_slow_op_threshold);
553555

554556
schedule_update_timer_task();
555557
}
@@ -3849,6 +3851,9 @@ void MDSRankDispatcher::handle_conf_change(const ConfigProxy& conf, const std::s
38493851
if (changed.count("mds_op_history_size") || changed.count("mds_op_history_duration")) {
38503852
op_tracker.set_history_size_and_duration(conf->mds_op_history_size, conf->mds_op_history_duration);
38513853
}
3854+
if (changed.count("mds_op_history_slow_op_size") || changed.count("mds_op_history_slow_op_threshold")) {
3855+
op_tracker.set_history_slow_op_size_and_threshold(conf->mds_op_history_slow_op_size, conf->mds_op_history_slow_op_threshold);
3856+
}
38523857
if (changed.count("mds_enable_op_tracker")) {
38533858
op_tracker.set_tracking(conf->mds_enable_op_tracker);
38543859
}

0 commit comments

Comments
 (0)