rocksdb/table/block_based
Maysam Yabandeh 3c0bb7fdd4 Fix SeekForPrev bug with Partitioned Filters and Prefix (#5907)
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
2019-10-16 10:45:17 -07:00
..
block_based_filter_block_test.cc Move the uncompression dictionary object out of the block cache (#5584) 2019-07-23 16:01:44 -07:00
block_based_filter_block.cc Fix regression affecting partitioned indexes/filters when cache_index_and_filter_blocks is false (#5705) 2019-08-15 11:11:55 -07:00
block_based_filter_block.h Move the filter readers out of the block cache (#5504) 2019-07-16 13:14:58 -07:00
block_based_table_builder.cc Add support for timestamp in Get/Put (#5079) 2019-06-05 23:10:47 -07:00
block_based_table_builder.h Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
block_based_table_factory.cc LRU Cache to enable mid-point insertion by default (#5508) 2019-06-27 10:20:57 -07:00
block_based_table_factory.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_based_table_reader.cc Fix data block upper bound checking for iterator reseek case (#5883) 2019-10-07 14:13:48 -07:00
block_based_table_reader.h Revert "Merging iterator to avoid child iterator reseek for some cases (#5286)" (#5871) 2019-10-01 16:00:00 -07:00
block_builder.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_builder.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_prefix_index.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
block_prefix_index.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_test.cc Add an option to put first key of each sst block in the index (#5289) 2019-06-24 20:54:04 -07:00
block_type.h Make the 'block read count' performance counters consistent (#5484) 2019-06-18 19:03:24 -07:00
block.cc Add an option to put first key of each sst block in the index (#5289) 2019-06-24 20:54:04 -07:00
block.h Add an option to put first key of each sst block in the index (#5289) 2019-06-24 20:54:04 -07:00
cachable_entry.h Move the filter readers out of the block cache (#5504) 2019-07-16 13:14:58 -07:00
data_block_footer.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
data_block_footer.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
data_block_hash_index_test.cc Add an option to put first key of each sst block in the index (#5289) 2019-06-24 20:54:04 -07:00
data_block_hash_index.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
data_block_hash_index.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
filter_block_reader_common.cc Fix regression affecting partitioned indexes/filters when cache_index_and_filter_blocks is false (#5705) 2019-08-15 11:11:55 -07:00
filter_block_reader_common.h Fix regression affecting partitioned indexes/filters when cache_index_and_filter_blocks is false (#5705) 2019-08-15 11:11:55 -07:00
filter_block.h Move the filter readers out of the block cache (#5504) 2019-07-16 13:14:58 -07:00
flush_block_policy.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
flush_block_policy.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
full_filter_block_test.cc Move the uncompression dictionary object out of the block cache (#5584) 2019-07-23 16:01:44 -07:00
full_filter_block.cc Fix regression affecting partitioned indexes/filters when cache_index_and_filter_blocks is false (#5705) 2019-08-15 11:11:55 -07:00
full_filter_block.h Move the filter readers out of the block cache (#5504) 2019-07-16 13:14:58 -07:00
index_builder.cc Add an option to put first key of each sst block in the index (#5289) 2019-06-24 20:54:04 -07:00
index_builder.h Add an option to put first key of each sst block in the index (#5289) 2019-06-24 20:54:04 -07:00
partitioned_filter_block_test.cc Fix SeekForPrev bug with Partitioned Filters and Prefix (#5907) 2019-10-16 10:45:17 -07:00
partitioned_filter_block.cc Fix SeekForPrev bug with Partitioned Filters and Prefix (#5907) 2019-10-16 10:45:17 -07:00
partitioned_filter_block.h Move the filter readers out of the block cache (#5504) 2019-07-16 13:14:58 -07:00
uncompression_dict_reader.cc Revert to storing UncompressionDicts in the cache (#5645) 2019-08-23 11:33:22 -07:00
uncompression_dict_reader.h Revert to storing UncompressionDicts in the cache (#5645) 2019-08-23 11:33:22 -07:00