Fix performance regression in Get() for block-based tables (#3953)

Summary:
This fixes a regression in one of myrocks regression tests (readwhilewriting), introduced in 8bf555f487

This PR changes two lines of code: one of them actually fixes the observed regression, the other is a mostly unrelated small fix that I'm piggy-backing here. EDIT: Nevermind, it fixes one line. More details in inline comments.
Closes https://github.com/facebook/rocksdb/pull/3953

Differential Revision: D8270664

Pulled By: al13n321

fbshipit-source-id: a7d91e196807d1e816551591257c700f70e4ccac
main
Mike Kolupaev 7 years ago committed by Facebook Github Bot
parent d0c38c0c8c
commit 812c7371d3
  1. 5
      table/block.h

@ -259,7 +259,7 @@ class BlockIter final : public InternalIterator {
}
// Makes Valid() return false, status() return `s`, and Seek()/Prev()/etc do
// nothing.
// nothing. Calls cleanup functions.
void Invalidate(Status s) {
// Assert that the BlockIter is never deleted while Pinning is Enabled.
assert(!pinned_iters_mgr_ ||
@ -269,6 +269,9 @@ class BlockIter final : public InternalIterator {
current_ = restarts_;
status_ = s;
// Call cleanup callbacks.
Cleanable::Reset();
// Clear prev entries cache.
prev_entries_keys_buff_.clear();
prev_entries_.clear();

Loading…
Cancel
Save