]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: ensure lec only accounts for up osds 34924/head
authorJoao Eduardo Luis <joao@suse.de>
Tue, 21 Nov 2017 10:18:24 +0000 (10:18 +0000)
committerNathan Cutler <ncutler@suse.com>
Wed, 6 May 2020 12:29:22 +0000 (14:29 +0200)
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>
(cherry picked from commit e62269c8929e414284ad0773c4a3c82e43735e4e)

src/mon/OSDMonitor.cc

index c176e0769efbabfa9eab5f622135c214da13f19c..7a317d1cfeed4d8b991bda370a06f5f586989d47 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;
     }
   }