]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add no counters in warning for standby-replay MDS
authorRishabh Dave <ridave@redhat.com>
Fri, 8 Mar 2024 15:31:51 +0000 (21:01 +0530)
committerRishabh Dave <ridave@redhat.com>
Mon, 3 Jun 2024 12:59:35 +0000 (18:29 +0530)
Don't include inode and stray counters in the health warnings printed
for standby-replay MDSs. Since these counters are present in the health
warnings only due to replay, it can confuse users, and therefore, do not
include them.

Fixes: https://tracker.ceph.com/issues/63514
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 03dcdc1329e471aa4aa403519ea5131db2f99b23)

src/mds/Beacon.cc

index b67e0a31b40735e84e73b1517603366139285cc6..7338b11d005e07dbd4d6530eb48a81be7cf50a0e 100644 (file)
@@ -512,9 +512,15 @@ void Beacon::notify_health(MDSRank const *mds)
   if (mds->mdcache->cache_overfull()) {
     CachedStackStringStream css;
     *css << "MDS cache is too large (" << bytes2str(mds->mdcache->cache_size())
-        << "/" << bytes2str(mds->mdcache->cache_limit_memory()) << "); "
-        << mds->mdcache->num_inodes_with_caps << " inodes in use by clients, "
-        << mds->mdcache->get_num_strays() << " stray files";
+        << "/" << bytes2str(mds->mdcache->cache_limit_memory()) << ")";
+    // Don't include inode and stray counters in the report for standby-replay
+    // MDSs. Since it is standby-replay, both will be zero, which might
+    // confuse users.
+    if (!mds->is_standby_replay()) {
+       *css << "; " << mds->mdcache->num_inodes_with_caps << " inodes in "
+            << "use by clients, " << mds->mdcache->get_num_strays()
+            << " stray files";
+    }
 
     MDSHealthMetric m(MDS_HEALTH_CACHE_OVERSIZED, HEALTH_WARN, css->strv());
     health.metrics.push_back(m);