rocksdb/table
Andrew Kryczka b45738622a Use user-provided ReadOptions for metadata block reads more often (#11208)
Summary:
This is mostly taken from https://github.com/facebook/rocksdb/issues/10427 with my own comments addressed. This PR plumbs the user’s `ReadOptions` down to `GetOrReadIndexBlock()`, `GetOrReadFilterBlock()`, and `GetFilterPartitionBlock()`. Now those functions no longer have to make up a `ReadOptions` with incomplete information.

I also let `PartitionIndexReader::NewIterator()` pass through its caller's `ReadOptions::verify_checksums`, which was inexplicably dropped previously.

Fixes https://github.com/facebook/rocksdb/issues/10463

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11208

Test Plan:
Functional:
- Measured `-verify_checksum=false` applies to metadata blocks read outside of table open
  - setup command: `TEST_TMPDIR=/tmp/100M-DB/ ./db_bench -benchmarks=filluniquerandom,waitforcompaction -write_buffer_size=1048576 -target_file_size_base=1048576 -max_bytes_for_level_base=4194304 -compression_type=none -num=1638400 -key_size=8 -value_size=56`
  - run command: `TEST_TMPDIR=/tmp/100M-DB/ ./db_bench -benchmarks=readrandom -use_existing_db=true -write_buffer_size=1048576 -target_file_size_base=1048576 -max_bytes_for_level_base=4194304 -compression_type=none -num=1638400 -key_size=8 -value_size=56 -duration=10 -threads=32 -cache_size=131072 -statistics=true -verify_checksum=false -open_files=20 -cache_index_and_filter_blocks=true`
  - before: `rocksdb.block.checksum.compute.count COUNT : 384353`
  - after: `rocksdb.block.checksum.compute.count COUNT : 22`

Performance:
- Setup command (tmpfs, 128MB logical data size, cache indexes/filters without pinning so index/filter lookups go through table reader): `TEST_TMPDIR=/dev/shm/128M-DB/ ./db_bench -benchmarks=filluniquerandom,waitforcompaction -write_buffer_size=131072 -target_file_size_base=131072 -max_bytes_for_level_base=524288 -compression_type=none -num=4194304 -key_size=8 -value_size=24 -bloom_bits=8 -whole_key_filtering=1`
- Measured point lookup performance. Database is fully cached to emphasize any new callstack overheads
  - Command: `TEST_TMPDIR=/dev/shm/128M-DB/ ./db_bench -benchmarks=readrandom[-W1][-X20] -use_existing_db=true -cache_index_and_filter_blocks=true -disable_auto_compactions=true -num=4194304 -key_size=8 -value_size=24 -bloom_bits=8 -whole_key_filtering=1 -duration=10 -cache_size=1048576000`
  - Before: `readrandom [AVG    20 runs] : 274848 (± 3717) ops/sec;    8.4 (± 0.1) MB/sec`
  - After: `readrandom [AVG    20 runs] : 277904 (± 4474) ops/sec;    8.5 (± 0.1) MB/sec`

Reviewed By: hx235

Differential Revision: D43145366

Pulled By: ajkr

fbshipit-source-id: 75ec062ece86a82cd788783de9de2c72df57f994
2023-04-04 16:53:14 -07:00
..
adaptive Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
block_based Use user-provided ReadOptions for metadata block reads more often (#11208) 2023-04-04 16:53:14 -07:00
cuckoo Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
plain Remove a couple deprecated convenience.h APIs (#11120) 2023-02-07 14:11:53 -08:00
block_fetcher.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
block_fetcher.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
block_fetcher_test.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
cleanable_test.cc Eliminate unnecessary (slow) block cache Ref()ing in MultiGet (#9899) 2022-04-26 21:59:24 -07:00
compaction_merging_iterator.cc Refactor AddRangeDels() + consider range tombstone during compaction file cutting (#11113) 2023-02-22 12:28:18 -08:00
compaction_merging_iterator.h Refactor AddRangeDels() + consider range tombstone during compaction file cutting (#11113) 2023-02-22 12:28:18 -08:00
format.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
format.h Major Cache refactoring, CPU efficiency improvement (#10975) 2023-01-11 14:20:40 -08:00
get_context.cc Rename a recently added PerfContext counter (#11294) 2023-03-13 18:43:27 -07:00
get_context.h Merge operator failed subcode (#11231) 2023-02-17 10:58:46 -08:00
internal_iterator.h remove unused InternalIteratorBase::is_mutable_ (#11104) 2023-01-19 13:28:58 -08:00
iter_heap.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
iterator.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
iterator_wrapper.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
merger_test.cc Print stack traces on frozen tests in CI (#10828) 2022-10-18 00:35:35 -07:00
merging_iterator.cc Improve documentation for MergingIterator (#11161) 2023-03-03 12:17:30 -08:00
merging_iterator.h Improve documentation for MergingIterator (#11161) 2023-03-03 12:17:30 -08:00
meta_blocks.cc Improve error messages for SST footer and size errors (#11009) 2022-12-09 10:03:47 -08:00
meta_blocks.h Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
mock_table.cc Align compaction output file boundaries to the next level ones (#10655) 2022-09-29 19:43:55 -07:00
mock_table.h Align compaction output file boundaries to the next level ones (#10655) 2022-09-29 19:43:55 -07:00
multiget_context.h Add a new MultiGetEntity API (#11222) 2023-02-15 09:34:17 -08:00
persistent_cache_helper.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
persistent_cache_helper.h Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
persistent_cache_options.h Use STATIC_AVOID_DESTRUCTION for static objects with non-trivial destructors (#9958) 2022-05-17 09:39:22 -07:00
scoped_arena_iterator.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
sst_file_dumper.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
sst_file_dumper.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
sst_file_reader.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
sst_file_reader_test.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
sst_file_writer.cc validate SstFileWriter range tombstones cover positive ranges (#11322) 2023-03-22 21:03:13 -07:00
sst_file_writer_collectors.h Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
table_builder.h Always verify SST unique IDs on SST file open (#10532) 2022-09-07 22:52:42 -07:00
table_factory.cc Remove FactoryFunc from LoadXXXObject (#11203) 2023-02-17 12:54:07 -08:00
table_properties.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
table_properties_internal.h Improve / clean up meta block code & integrity (#9163) 2021-11-18 11:43:44 -08:00
table_reader.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
table_reader_bench.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
table_test.cc Tests verifying non-zero checksums of zero bytes (#11260) 2023-03-06 11:53:09 -08:00
two_level_iterator.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
two_level_iterator.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
unique_id.cc Derive cache keys from SST unique IDs (#10394) 2022-08-12 13:49:49 -07:00
unique_id_impl.h Derive cache keys from SST unique IDs (#10394) 2022-08-12 13:49:49 -07:00