]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make threshold for MDS_TRIM configurable 35415/head
authorPaul Emmerich <paul.emmerich@croit.io>
Fri, 5 Jun 2020 11:54:15 +0000 (13:54 +0200)
committerPaul Emmerich <paul.emmerich@croit.io>
Tue, 30 Jun 2020 16:26:37 +0000 (18:26 +0200)
Fixes: https://tracker.ceph.com/issues/45906
Signed-off-by: Paul Emmerich <paul.emmerich@croit.io>
doc/cephfs/health-messages.rst
src/common/options.cc
src/mds/Beacon.cc

index 2e79c7bfa15b7baccf7a550913a55568bf7b46ac..54e334111e50c91fc671c770325e2adacf99f69b 100644 (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
index 3245ce0ac4bec7246e1f0b9293c04ad9c6ac76f9..55bd19bb6587485dce4ec69343f0215a3460d904 100644 (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"),
index c6da7cd242a596e5e8347af474470e38440af0ce..8869d6e1e21de70b89cf7632c70abac4e371acb8 100644 (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 << ")";