From 005816536cea0de47452720a09841ba31c841169 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 9 Aug 2013 17:59:25 -0700 Subject: PGMap: calc_min_last_epoch_clean() will now also use osd_epochs We don't want to trim past the current osd map for any up osd. osd_epochs provides a lower bound for that epoch for each osd. Signed-off-by: Samuel Just --- src/mon/PGMap.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 2cbf1a6c2fb..516c8dd8b9b 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -432,6 +432,14 @@ epoch_t PGMap::calc_min_last_epoch_clean() const if (lec < min) min = lec; } + // also scan osd epochs + // don't trim past the oldest reported osd epoch + for (hash_map::const_iterator i = osd_epochs.begin(); + i != osd_epochs.end(); + ++i) { + if (i->second < min) + min = i->second; + } return min; } -- cgit v1.2.1