]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: do not clog muted health warnings
authorPatrick Donnelly <pdonnell@ibm.com>
Sun, 17 May 2026 14:48:24 +0000 (10:48 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Fri, 22 May 2026 13:47:12 +0000 (09:47 -0400)
Otherwise, even when we explicitly mute the warning, the health log
lines still appear and fail tests. This troublesome for the kclient
fallback to aes where we want to conditionally mute relevant warnings.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Change-Id: b57e8d3c-4d38-462b-8d22-399916efdf5b

src/mon/HealthMonitor.h
src/mon/Monitor.cc

index 67a3c31e487c6df20c2fd336c7ec54d2c6806780..ed2bb190b6030062f316ce27b32968abc910a93a 100644 (file)
@@ -88,6 +88,11 @@ private:
   bool check_leader_health();
   bool check_member_health();
   bool check_mutes();
+
+public:
+  bool is_muted(const std::string& code) const {
+    return mutes.count(code) > 0;
+  }
 };
 
 #endif // CEPH_HEALTH_MONITOR_H
index 0a2d16aad7b19f462eaa4c15ffd24dfd69633219..555f862ee48019aae92865f5f2dc262e6be38650 100644 (file)
@@ -3066,6 +3066,10 @@ void Monitor::log_health(
   const auto min_log_period = g_conf().get_val<int64_t>(
       "mon_health_log_update_period");
   for (auto& p : updated.checks) {
+    if (healthmon()->is_muted(p.first)) {
+      continue;
+    }
+
     auto q = previous.checks.find(p.first);
     bool logged = false;
     if (q == previous.checks.end()) {
@@ -6055,6 +6059,11 @@ void Monitor::tick()
 
       for (const auto &i : health.checks) {
         const std::string &code = i.first;
+
+        if (healthmon()->is_muted(code)) {
+          continue;
+        }
+
         const std::string &summary = i.second.summary;
         const health_status_t severity = i.second.severity;