mds: make threshold for MDS_TRIM configurable

Fixes: https://tracker.ceph.com/issues/45906
Signed-off-by: Paul Emmerich <paul.emmerich@croit.io>
This commit is contained in:
Paul Emmerich 2020-06-05 13:54:15 +02:00
parent bfd46d7d25
commit d905678a87
3 changed files with 10 additions and 4 deletions

View File

@ -59,8 +59,8 @@ by the setting ``mds_log_max_segments``, and when the number of segments
exceeds that setting the MDS starts writing back metadata so that it
can remove (trim) the oldest segments. If this writeback is happening
too slowly, or a software bug is preventing trimming, then this health
message may appear. The threshold for this message to appear is for the
number of segments to be double ``mds_log_max_segments``.
message may appear. The threshold for this message to appear is controlled by
the config option ``mds_log_warn_factor``, the default is 2.0.
Message: "Client *name* failing to respond to capability release"
Code: MDS_HEALTH_CLIENT_LATE_RELEASE, MDS_HEALTH_CLIENT_LATE_RELEASE_MANY

View File

@ -7952,6 +7952,12 @@ std::vector<Option> get_mds_options() {
.set_default(128)
.set_description("maximum number of segments which may be untrimmed"),
Option("mds_log_warn_factor", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
.set_default(2.0)
.set_min(1.0)
.set_flag(Option::FLAG_RUNTIME)
.set_description("trigger MDS_HEALTH_TRIM warning when the mds log is longer than mds_log_max_segments * mds_log_warn_factor"),
Option("mds_bal_export_pin", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(true)
.set_description("allow setting directory export pins to particular ranks"),

View File

@ -304,9 +304,9 @@ void Beacon::notify_health(MDSRank const *mds)
}
// Detect MDS_HEALTH_TRIM condition
// Arbitrary factor of 2, indicates MDS is not trimming promptly
// Indicates MDS is not trimming promptly
{
if (mds->mdlog->get_num_segments() > (size_t)(g_conf()->mds_log_max_segments * 2)) {
if (mds->mdlog->get_num_segments() > (size_t)(g_conf()->mds_log_max_segments * g_conf().get_val<double>("mds_log_warn_factor"))) {
std::ostringstream oss;
oss << "Behind on trimming (" << mds->mdlog->get_num_segments()
<< "/" << g_conf()->mds_log_max_segments << ")";