From: Rishabh Dave Date: Fri, 8 Mar 2024 15:31:51 +0000 (+0530) Subject: mds: add no counters in warning for standby-replay MDS X-Git-Tag: v18.2.5~600^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eeea18abf36c7e31471e5f3cd0db1ed4d5b0717b;p=ceph.git 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) --- diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index b67e0a31b407..7338b11d005e 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);