提交 b560fc9f 编写于 作者: S Siying Dong 提交者: Facebook Github Bot

Fix a block pinning regression introduced in b555ed30

Summary:
b555ed30 introduces a regression, which causes blocks always to be pinned in block based iterators. Fix it.
Closes https://github.com/facebook/rocksdb/pull/3582

Differential Revision: D7189534

Pulled By: siying

fbshipit-source-id: 117dc7a03d0a0e360424db02efb366e12da2be03
上级 e69f6e86
......@@ -545,9 +545,10 @@ class BlockBasedTableIterator : public InternalIterator {
}
bool IsKeyPinned() const override {
return pinned_iters_mgr_ && pinned_iters_mgr_->PinningEnabled() &&
block_iter_points_to_real_block_;
block_iter_points_to_real_block_ && data_block_iter_.IsKeyPinned();
}
bool IsValuePinned() const override {
// BlockIter::IsValuePinned() is always true. No need to check
return pinned_iters_mgr_ && pinned_iters_mgr_->PinningEnabled() &&
block_iter_points_to_real_block_;
}
......@@ -566,7 +567,7 @@ class BlockBasedTableIterator : public InternalIterator {
void ResetDataIter() {
if (block_iter_points_to_real_block_) {
if (pinned_iters_mgr_ != nullptr) {
if (pinned_iters_mgr_ != nullptr && pinned_iters_mgr_->PinningEnabled()) {
data_block_iter_.DelegateCleanupsTo(pinned_iters_mgr_);
}
data_block_iter_.~BlockIter();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册