3c0bb7fdd4
Summary: Partition Filters make use of a top-level index to find the partition that might have the bloom hash of the key. The index is with internal key format (before format version 3). Each partition contains the i) blooms of the keys in that range ii) bloom of prefixes of keys in that range, iii) the bloom of the prefix of the last key in the previous partition. When ::SeekForPrev(key), we first perform a prefix bloom test on the SST file. The partition however is identified using the full internal key, rather than the prefix key. The reason is to be compatible with the internal key format of the top-level index. This creates a corner case. Example: - SST k, Partition N: P1K1, P1K2 - SST k, top-level index: P1K2 - SST k+1, Partition 1: P2K1, P3K1 - SST k+1 top-level index: P3K1 When SeekForPrev(P1K3), it should point us to P1K2. However SST k top-level index would reject P1K3 since it is out of range. One possible fix would be to search with the prefix P1 (instead of full internal key P1K3) however the details of properly comparing prefix with full internal key might get complicated. The fix we apply in this PR is to look into the last partition anyway even if the key is out of range. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5907 Differential Revision: D17889918 Pulled By: maysamyabandeh fbshipit-source-id: 169fd7b3c71dbc08808eae5a8340611ebe5bdc1e |
||
---|---|---|
.. | ||
adaptive | ||
block_based | ||
cuckoo | ||
plain | ||
block_fetcher.cc | ||
block_fetcher.h | ||
bloom_block.cc | ||
bloom_block.h | ||
cleanable_test.cc | ||
format.cc | ||
format.h | ||
full_filter_bits_builder.h | ||
get_context.cc | ||
get_context.h | ||
internal_iterator.h | ||
iter_heap.h | ||
iterator_wrapper.h | ||
iterator.cc | ||
merger_test.cc | ||
merging_iterator.cc | ||
merging_iterator.h | ||
meta_blocks.cc | ||
meta_blocks.h | ||
mock_table.cc | ||
mock_table.h | ||
multiget_context.h | ||
persistent_cache_helper.cc | ||
persistent_cache_helper.h | ||
persistent_cache_options.h | ||
scoped_arena_iterator.h | ||
sst_file_reader_test.cc | ||
sst_file_reader.cc | ||
sst_file_writer_collectors.h | ||
sst_file_writer.cc | ||
table_builder.h | ||
table_properties_internal.h | ||
table_properties.cc | ||
table_reader_bench.cc | ||
table_reader_caller.h | ||
table_reader.h | ||
table_test.cc | ||
two_level_iterator.cc | ||
two_level_iterator.h |