Skip to content

Commit 03dcdc1

Browse files
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 <[email protected]>
1 parent addad6c commit 03dcdc1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/mds/Beacon.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,15 @@ void Beacon::notify_health(MDSRank const *mds)
490490
if (mds->mdcache->cache_overfull()) {
491491
CachedStackStringStream css;
492492
*css << "MDS cache is too large (" << bytes2str(mds->mdcache->cache_size())
493-
<< "/" << bytes2str(mds->mdcache->cache_limit_memory()) << "); "
494-
<< mds->mdcache->num_inodes_with_caps << " inodes in use by clients, "
495-
<< mds->mdcache->get_num_strays() << " stray files";
493+
<< "/" << bytes2str(mds->mdcache->cache_limit_memory()) << ")";
494+
// Don't include inode and stray counters in the report for standby-replay
495+
// MDSs. Since it is standby-replay, both will be zero, which might
496+
// confuse users.
497+
if (!mds->is_standby_replay()) {
498+
*css << "; " << mds->mdcache->num_inodes_with_caps << " inodes in "
499+
<< "use by clients, " << mds->mdcache->get_num_strays()
500+
<< " stray files";
501+
}
496502

497503
MDSHealthMetric m(MDS_HEALTH_CACHE_OVERSIZED, HEALTH_WARN, css->strv());
498504
health.metrics.push_back(m);

0 commit comments

Comments
 (0)