]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: increase last_epoch_clean's lower bound if possible 14855/head
authorKefu Chai <kchai@redhat.com>
Fri, 28 Apr 2017 00:44:46 +0000 (08:44 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 28 Apr 2017 00:44:46 +0000 (08:44 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/OSDMonitor.cc

index 212195ffd1fadb2f7e43fab8bfd4428e2154d492..1bcd8e10fab2a09b07c3c804bdba8bad5522315e 100644 (file)
@@ -80,13 +80,21 @@ void LastEpochClean::Lec::report(ps_t ps, epoch_t last_epoch_clean)
   if (epoch_by_pg.size() <= ps) {
     epoch_by_pg.resize(ps + 1, 0);
   }
-  if (epoch_by_pg[ps] >= last_epoch_clean) {
+  const auto old_lec = epoch_by_pg[ps];
+  if (old_lec >= last_epoch_clean) {
     // stale lec
     return;
   }
   epoch_by_pg[ps] = last_epoch_clean;
   if (last_epoch_clean < floor) {
     floor = last_epoch_clean;
+  } else if (last_epoch_clean > floor) {
+    if (old_lec == floor) {
+      // probably should increase floor?
+      auto new_floor = std::min_element(std::begin(epoch_by_pg),
+                                       std::end(epoch_by_pg));
+      floor = *new_floor;
+    }
   }
   if (ps != next_missing) {
     return;