]> git-server-git.apps.pok.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>
Fri, 19 Apr 2024 04:09:14 +0000 (09:39 +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>
src/mds/Beacon.cc

index c71030d7d2115eab3f9430c228760957d86231ea..9c919d36b899b48e4668e44b094ef160469ac3c2 100644 (file)
@@ -490,9 +490,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);