[RocksDB] Fix binary search while finding probable wal files

Summary:
RocksDB does a binary search to look at the files which might contain the requested sequence number at the call GetUpdatesSince.
There was a bug in the binary search => when the file pointed by the middle index of bsearch was empty/corrupt it needst to resize the vector and update indexes.
This now fixes that.

Test Plan: existing unit tests pass.

Reviewers: heyongqiang, dhruba

Reviewed By: heyongqiang

CC: leveldb

Differential Revision: https://reviews.facebook.net/D9777
main
Abhishek Kona 12 years ago
parent 8e9c781ae5
commit 3b51605b8d
  1. 4
      db/db_impl.cc

@ -934,9 +934,7 @@ Status DBImpl::FindProbableWALFiles(std::vector<LogFile>* const allLogs,
if (!s.ok()) {
if (CheckFileExistsAndEmpty(allLogs->at(mid))) {
allLogs->erase(allLogs->begin() + mid);
if (mid == start) {
++start;
}
--end;
continue;
}
return s;

Loading…
Cancel
Save