Skip to content

Commit c5a5e76

Browse files
authored
Merge pull request ceph#57005 from cfsnyder/wip-cfsnyder-63195
mgr/Mgr.cc: clear daemon health metrics instead of removing down/out osd from daemon state Reviewed-by: Radoslaw Zarzynski <[email protected]>
2 parents ec469b9 + 282558c commit c5a5e76

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/mgr/Mgr.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ void Mgr::handle_osd_map()
498498
cluster_state.with_osdmap_and_pgmap([this, &names_exist](const OSDMap &osd_map,
499499
const PGMap &pg_map) {
500500
for (int osd_id = 0; osd_id < osd_map.get_max_osd(); ++osd_id) {
501-
if (!osd_map.exists(osd_id) || (osd_map.is_out(osd_id) && osd_map.is_down(osd_id))) {
501+
if (!osd_map.exists(osd_id)) {
502502
continue;
503503
}
504504

@@ -510,9 +510,16 @@ void Mgr::handle_osd_map()
510510
if (daemon_state.is_updating(k)) {
511511
continue;
512512
}
513+
514+
DaemonStatePtr daemon = daemon_state.get(k);
515+
516+
if (daemon && osd_map.is_out(osd_id) && osd_map.is_down(osd_id)) {
517+
std::lock_guard l(daemon->lock);
518+
daemon->daemon_health_metrics.clear();
519+
}
513520

514521
bool update_meta = false;
515-
if (daemon_state.exists(k)) {
522+
if (daemon) {
516523
if (osd_map.get_up_from(osd_id) == osd_map.get_epoch()) {
517524
dout(4) << "Mgr::handle_osd_map: osd." << osd_id
518525
<< " joined cluster at " << "e" << osd_map.get_epoch()

0 commit comments

Comments
 (0)