mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-27 02:44:18 +00:00
1da9ac2363
Summary: **Context/Summary:** When db is upgrading to adopt [pr11406](https://github.com/facebook/rocksdb/pull/11406/), it's possible for RocksDB to infer a small tail size to prefetch for pre-upgrade files. Such small tail size would have caused 1 file read per index or filter partition if partitioned index or filer is used. This PR provides a UT to show this would not happen. Misc: refactor the related UTs a bit to make this new UT more readable. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11522 Test Plan: - New UT If logic of upgrade is wrong e.g, ``` --- a/table/block_based/partitioned_index_reader.cc +++ b/table/block_based/partitioned_index_reader.cc @@ -166,7 +166,8 @@ Status PartitionIndexReader::CacheDependencies( uint64_t prefetch_len = last_off - prefetch_off; std::unique_ptr<FilePrefetchBuffer> prefetch_buffer; if (tail_prefetch_buffer == nullptr || !tail_prefetch_buffer->Enabled() || - tail_prefetch_buffer->GetPrefetchOffset() > prefetch_off) { + (false && tail_prefetch_buffer->GetPrefetchOffset() > prefetch_off)) { ``` , then the UT will fail like below ``` [ RUN ] PrefetchTailTest/PrefetchTailTest.UpgradeToTailSizeInManifest/0 file/prefetch_test.cc:461: Failure Expected: (db_open_file_read.count) < (num_index_partition), actual: 38 vs 33 Received signal 11 (Segmentation fault) ``` Reviewed By: pdillinger Differential Revision: D46546707 Pulled By: hx235 fbshipit-source-id: 9897b0a975e9055963edac5451fd1cd9d6c45d0e |
||
---|---|---|
.. | ||
delete_scheduler.cc | ||
delete_scheduler.h | ||
delete_scheduler_test.cc | ||
file_prefetch_buffer.cc | ||
file_prefetch_buffer.h | ||
file_util.cc | ||
file_util.h | ||
filename.cc | ||
filename.h | ||
line_file_reader.cc | ||
line_file_reader.h | ||
prefetch_test.cc | ||
random_access_file_reader.cc | ||
random_access_file_reader.h | ||
random_access_file_reader_test.cc | ||
read_write_util.cc | ||
read_write_util.h | ||
readahead_file_info.h | ||
readahead_raf.cc | ||
readahead_raf.h | ||
sequence_file_reader.cc | ||
sequence_file_reader.h | ||
sst_file_manager_impl.cc | ||
sst_file_manager_impl.h | ||
writable_file_writer.cc | ||
writable_file_writer.h |