]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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>
Thu, 30 May 2024 18:20:57 +0000 (23:50 +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 f4d762d4f8dfba4422dfca2bfa3620b505c9b9f1..10f2b79e66419f8e3b1be3a720aa93d6b87403bf 100644 (file)
@@ -514,9 +514,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);