From: Sage Weil Date: Fri, 21 Jun 2019 02:54:09 +0000 (-0500) Subject: mon/OSDMonitor: fix bug in try_prune_purged_snaps X-Git-Tag: v15.1.0~2308^2~11 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6b26fcd1bdd8910cb2dbd84fe342cd65be2a70ec;p=ceph-ci.git mon/OSDMonitor: fix bug in try_prune_purged_snaps If 'begin' isn't found, we'll get a [pbegin,pend) range back that was nearby. Only if it overlaps the [begin,end) range do we want to shorten our range to [begin,pbegin); the old assert was making the assumption that the lookup would only return a range that was after 'begin', but in reality it can return was that comes before it too. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index af8de92546b..19dab91add3 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -6471,9 +6471,8 @@ bool OSDMonitor::try_prune_purged_snaps() << "~" << (pend - pbegin) << dendl; break; // next pool } - if (pbegin && pbegin < end) { + if (pbegin && pbegin > begin && pbegin < end) { // the tail of [begin,end) is purged; shorten the range - ceph_assert(pbegin > begin); end = pbegin; } to_prune.insert(begin, end - begin);