From: Kefu Chai Date: Fri, 28 Apr 2017 00:44:46 +0000 (+0800) Subject: mon/OSDMonitor: increase last_epoch_clean's lower bound if possible X-Git-Tag: v12.0.3~171^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7cc515e44a3c7fffb850b2f8fda05dd2e97de6bf;p=ceph.git mon/OSDMonitor: increase last_epoch_clean's lower bound if possible Signed-off-by: Kefu Chai --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 212195ffd1fa..1bcd8e10fab2 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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;