From 812c7371d3ac3840b1f88c59e7f514407ae45dc4 Mon Sep 17 00:00:00 2001 From: Mike Kolupaev Date: Tue, 5 Jun 2018 11:32:07 -0700 Subject: [PATCH] Fix performance regression in Get() for block-based tables (#3953) Summary: This fixes a regression in one of myrocks regression tests (readwhilewriting), introduced in https://github.com/facebook/rocksdb/commit/8bf555f487d1de84a4fb19cb97b9ae1a8dbebc60 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 --- table/block.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/table/block.h b/table/block.h index bac9afc81..1fed0e297 100644 --- a/table/block.h +++ b/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();