]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make threshold for MDS_TRIM configurable 36175/head
authorPaul Emmerich <paul.emmerich@croit.io>
Fri, 5 Jun 2020 11:54:15 +0000 (13:54 +0200)
committerNathan Cutler <ncutler@suse.com>
Sat, 18 Jul 2020 15:55:18 +0000 (17:55 +0200)
Fixes: https://tracker.ceph.com/issues/45906
Signed-off-by: Paul Emmerich <paul.emmerich@croit.io>
(cherry picked from commit d905678a87326195c71ce6da16933e671b0d90eb)

doc/cephfs/health-messages.rst
src/common/options.cc
src/mds/Beacon.cc

index aa93a9d7142def552b2df43134636fc549346919..b096e124c9714cde0cd5a3906b3b8fef05c19534 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 149d14db7c8fa9c2ec4c7121ae29cd3ebb59fda1..bef638278fe08781e6c22bd36a3899b61e65a140 100644 (file)
@@ -7848,6 +7848,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 2fe17410d4d9915d9341a89c564b6636e25f0b44..b374171c57a9d38cb1593e213a6ad9ae089302e1 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 << ")";