]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/OSDMonitor: fix bug in try_prune_purged_snaps
authorSage Weil <sage@redhat.com>
Fri, 21 Jun 2019 02:54:09 +0000 (21:54 -0500)
committerSage Weil <sage@redhat.com>
Tue, 2 Jul 2019 13:37:51 +0000 (08:37 -0500)
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 <sage@redhat.com>
src/mon/OSDMonitor.cc

index af8de92546bfa24c1ede7db17681ddd1717c7bf2..19dab91add3ac4da568c593d2b69572ae3bacab9 100644 (file)
@@ -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);