Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix range tombstone covering short-circuit logic #4698

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
### New Features
* Introduced `Memoryllocator`, which lets the user specify custom memory allocator for block based table.

### Bug Fixes
* Fixed Get correctness bug in the presence of range tombstones where merge operands covered by a range tombstone always result in NotFound.

## 5.18.0 (11/12/2018)
### New Features
* Introduced `PerfContextByLevel` as part of `PerfContext` which allows storing perf context at each level. Also replaced `__thread` with `thread_local` keyword for perf_context. Added per-level perf context for bloom filter and `Get` query.
Expand Down
4 changes: 0 additions & 4 deletions db/memtable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,6 @@ bool MemTable::Get(const LookupKey& key, std::string* value, Status* s,
// Avoiding recording stats for speed.
return false;
}
if (*max_covering_tombstone_seq > 0) {
*s = Status::NotFound();
return true;
}
PERF_TIMER_GUARD(get_from_memtable_time);

std::unique_ptr<InternalIterator> range_del_iter(
Expand Down
6 changes: 3 additions & 3 deletions db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1210,9 +1210,9 @@ void Version::Get(const ReadOptions& read_options, const LookupKey& k,

while (f != nullptr) {
if (*max_covering_tombstone_seq > 0) {
// Use empty error message for speed
*status = Status::NotFound();
return;
// The remaining files we look at will only contain covered keys, so we
// stop here.
break;
}
if (get_context.sample()) {
sample_file_read_inc(f->file_metadata);
Expand Down