提交 8d70e531 编辑于 作者: Andrew Kryczka's avatar Andrew Kryczka
浏览文件

Fix bug in pinned partitioned user key indexes

Backports part of 75d3b6fdf0aa1007c4d26382f65be0adf4519a37.
上级 5a4b8005
# Rocksdb Change Log # Rocksdb Change Log
## Unreleased
### Bug Fixes
* Fixed a bug in the following combination of features: indexes with user keys (`format_version >= 3`), indexes are partitioned (`index_type == kTwoLevelIndexSearch`), and some index partitions are pinned in memory (`BlockBasedTableOptions::pin_l0_filter_and_index_blocks_in_cache`). The bug could cause keys to be truncated when read from the index leading to wrong read results or other unexpected behavior.
## 6.11.5 (7/23/2020) ## 6.11.5 (7/23/2020)
### Bug Fixes ### Bug Fixes
* Memtable lookup should report unrecognized value_type as corruption (#7121). * Memtable lookup should report unrecognized value_type as corruption (#7121).
......
...@@ -142,6 +142,11 @@ class IteratorWrapperBase { ...@@ -142,6 +142,11 @@ class IteratorWrapperBase {
return result_.value_prepared; return result_.value_prepared;
} }
Slice user_key() const {
assert(Valid());
return iter_->user_key();
}
private: private:
void Update() { void Update() {
valid_ = iter_->Valid(); valid_ = iter_->Valid();
......
...@@ -43,6 +43,10 @@ class TwoLevelIndexIterator : public InternalIteratorBase<IndexValue> { ...@@ -43,6 +43,10 @@ class TwoLevelIndexIterator : public InternalIteratorBase<IndexValue> {
assert(Valid()); assert(Valid());
return second_level_iter_.key(); return second_level_iter_.key();
} }
Slice user_key() const override {
assert(Valid());
return second_level_iter_.user_key();
}
IndexValue value() const override { IndexValue value() const override {
assert(Valid()); assert(Valid());
return second_level_iter_.value(); return second_level_iter_.value();
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册