Skip to content

Commit 091d516

Browse files
Merge pull request ceph#65422 from NitzanMordhai/wip-nitzan-destroyed-osds-remove-health-msgs
mgr: remove health msgs from the metrics if osd destroyed
2 parents 35917d4 + 3db2b57 commit 091d516

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/mgr/Mgr.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,15 @@ void Mgr::handle_osd_map()
517517

518518
DaemonStatePtr daemon = daemon_state.get(k);
519519

520-
if (daemon && osd_map.is_out(osd_id) && osd_map.is_down(osd_id)) {
521-
std::lock_guard l(daemon->lock);
522-
daemon->daemon_health_metrics.clear();
520+
if (daemon) {
521+
bool clear_metrics = false;
522+
clear_metrics |= (osd_map.is_out(osd_id) && osd_map.is_down(osd_id));
523+
clear_metrics |= osd_map.is_destroyed(osd_id);
524+
if (clear_metrics) {
525+
// clear any health metrics for an OSD that is (out and down) or destroyed
526+
std::lock_guard l(daemon->lock);
527+
daemon->daemon_health_metrics.clear();
528+
}
523529
}
524530

525531
bool update_meta = false;

0 commit comments

Comments
 (0)