]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/HealthMonitor: automatically clear non-sticky mutes when alert clears
authorSage Weil <sage@redhat.com>
Wed, 31 Jul 2019 05:19:39 +0000 (00:19 -0500)
committerSage Weil <sage@redhat.com>
Thu, 15 Aug 2019 01:40:08 +0000 (20:40 -0500)
If the alert goes away, drop the mute.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/HealthMonitor.cc

index b028adb8afb2264fea0284a98b9fb63074ee77e3..3f8ed8f9ab544cb28b87d954c38724593c369dc6 100644 (file)
@@ -364,6 +364,8 @@ bool HealthMonitor::check_mutes()
 {
   bool changed = true;
   auto now = ceph_clock_now();
+  health_check_map_t all;
+  gather_all_health_checks(&all);
   auto p = pending_mutes.begin();
   while (p != pending_mutes.end()) {
     if (p->second.ttl != utime_t() &&
@@ -372,6 +374,12 @@ bool HealthMonitor::check_mutes()
                        << " cleared (passed TTL " << p->second.ttl << ")";
       p = pending_mutes.erase(p);
       changed = true;
+    } else if (!p->second.sticky &&
+              all.checks.count(p->first) == 0) {
+      mon->clog->info() << "Health alert mute " << p->first
+                       << " cleared (health alert cleared)";
+      p = pending_mutes.erase(p);
+      changed = true;
     } else {
       ++p;
     }