From eeea18abf36c7e31471e5f3cd0db1ed4d5b0717b Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Fri, 8 Mar 2024 21:01:51 +0530 Subject: [PATCH] mds: add no counters in warning for standby-replay MDS 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 (cherry picked from commit 03dcdc1329e471aa4aa403519ea5131db2f99b23) --- src/mds/Beacon.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index b67e0a31b4073..7338b11d005e0 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -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); -- 2.39.5