From ebbe29dd8cd514e2e0914f192b47569fc01cd4d2 Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Tue, 21 Nov 2017 10:18:24 +0000 Subject: [PATCH] mon/OSDMonitor: ensure lec only accounts for up osds If we also consider down osds, we may very well be in a healthy state but keeping maps as far back as the last epoch when a given osd went down. If said osd stays down for eons, we will be keeping bajillions of maps that we shouldn't. Signed-off-by: Joao Eduardo Luis (cherry picked from commit e62269c8929e414284ad0773c4a3c82e43735e4e) --- src/mon/OSDMonitor.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index f4f887b4280d0..46aa5f151eb79 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -347,7 +347,7 @@ void LastEpochClean::dump(Formatter *f) const { f->open_array_section("per_pool"); - for (auto it : report_by_pool) { + for (auto& it : report_by_pool) { f->open_object_section("pool"); f->dump_unsigned("poolid", it.first); f->dump_unsigned("floor", it.second.floor); @@ -2080,7 +2080,8 @@ epoch_t OSDMonitor::get_min_last_epoch_clean() const // also scan osd epochs // don't trim past the oldest reported osd epoch for (auto& osd_epoch : osd_epochs) { - if (osd_epoch.second < floor) { + if (osd_epoch.second < floor && + osdmap.is_out(osd_epoch.first)) { floor = osd_epoch.second; } } -- 2.39.5