]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: ensure lec only accounts for up osds 19076/head
authorJoao Eduardo Luis <joao@suse.de>
Tue, 21 Nov 2017 10:18:24 +0000 (10:18 +0000)
committerJoao Eduardo Luis <joao@suse.de>
Mon, 23 Mar 2020 14:58:59 +0000 (14:58 +0000)
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 <joao@suse.de>
src/mon/OSDMonitor.cc

index 25a289333cfbbb42e126140106ab40114729abf0..dbf8d255850cbb5cc5da578274dee76d3504509e 100644 (file)
@@ -382,7 +382,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);
@@ -2215,7 +2215,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;
     }
   }