]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PGMap: calc_min_last_epoch_clean() will now also use osd_epochs
authorSamuel Just <sam.just@inktank.com>
Sat, 10 Aug 2013 00:59:25 +0000 (17:59 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 4 Oct 2013 20:49:55 +0000 (13:49 -0700)
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.

Fixes: 5869
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/mon/PGMap.cc

index 0b40e9264ceadc9acc75e7cc18cf8d96fd7abc8b..13a2af33213c67c66a2125bc1cadd0dd81296e6a 100644 (file)
@@ -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<int32_t, epoch_t>::const_iterator i = osd_epochs.begin();
+       i != osd_epochs.end();
+       ++i) {
+    if (i->second < min)
+      min = i->second;
+  }
   return min;
 }