Skip to content

Commit 3db2b57

Browse files
committed
mgr: remove health msgs from the metrics if osd destroyed
clears daemon health metrics for destroyed osds alon with down and out OSDs Fixes: https://tracker.ceph.com/issues/72899 Signed-off-by: Nitzan Mordechai <[email protected]>
1 parent 28ea896 commit 3db2b57

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
@@ -516,9 +516,15 @@ void Mgr::handle_osd_map()
516516

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

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

524530
bool update_meta = false;

0 commit comments

Comments
 (0)