From e17e92ea1968a308dda83ed33d86da2e190a6566 Mon Sep 17 00:00:00 2001 From: Andres Notzli Date: Tue, 8 Sep 2015 17:15:11 -0700 Subject: [PATCH] Relaxed assert in forward iterator Summary: It looks like in some cases an assert in SeekInternal failed when computing the hints for the next level because user_key was the same as the largest key and not strictly smaller. Relaxing the assert to expect smaller or equal keys. Test Plan: make clean all check Reviewers: sdong Reviewed By: sdong Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D46443 --- db/forward_iterator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/forward_iterator.cc b/db/forward_iterator.cc index 7ad41c399..c0d7647c5 100644 --- a/db/forward_iterator.cc +++ b/db/forward_iterator.cc @@ -335,7 +335,7 @@ void ForwardIterator::SeekInternal(const Slice& internal_key, int cmp_smallest = user_comparator_->Compare( user_key, level_files[f_idx]->smallest.user_key()); assert(user_comparator_->Compare( - user_key, level_files[f_idx]->largest.user_key()) < 0); + user_key, level_files[f_idx]->largest.user_key()) <= 0); indexer.GetNextLevelIndex(level, f_idx, cmp_smallest, -1, &search_left_bound, &search_right_bound); } else {