From 57d216ea6518c7f34eaea6538690bc52e6c605d1 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Tue, 7 Jul 2015 12:45:06 -0700 Subject: [PATCH] Remove assert(current_ == CurrentReverse()) in MergingIterator::Prev() Summary: Remove assert(current_ == CurrentReverse()) in MergingIterator::Prev() because it is possible to have some keys larger than the seek-key inserted between Seek() and SeekToLast(), which makes current_ not equal to CurrentReverse(). Test Plan: db_stress Reviewers: igor, sdong, IslamAbdelRahman, anthony Reviewed By: anthony Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D41331 --- table/merger.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/table/merger.cc b/table/merger.cc index 22886f1d6..f380e0137 100644 --- a/table/merger.cc +++ b/table/merger.cc @@ -186,9 +186,12 @@ class MergingIterator : public Iterator { } } direction_ = kReverse; - // The loop retreated all non-current children to be < key() so current_ - // should still be strictly the largest key. - assert(current_ == CurrentReverse()); + // Note that we don't do assert(current_ == CurrentReverse()) here + // because it is possible to have some keys larger than the seek-key + // inserted between Seek() and SeekToLast(), which makes current_ not + // equal to CurrentReverse(). + // + // assert(current_ == CurrentReverse()); } current_->Prev();