[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
This commit is contained in:
parent
8e9c781ae5
commit
3b51605b8d
@ -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…
Reference in New Issue
Block a user