mirror of https://github.com/facebook/rocksdb.git
7c98a2d130
Summary: There is a `strict_capacity_limit` option which imposes a hard memory limit on the block cache. When the block cache is enabled, every read request is serviced from the block cache. If the required block is missing, it is first inserted into the cache. If `strict_capacity_limit` is `true` and the limit has been reached, the `Get` and `MultiGet` requests should fail. However, currently this is not happening for `MultiGet`. I updated `MultiGet` to explicitly check the returned status of `MaybeReadBlockAndLoadToCache`, so the status does not get overwritten later. Thank you anand1976 for the problem explanation. Pull Request resolved: https://github.com/facebook/rocksdb/pull/13104 Test Plan: Added unit test for both `Get` and `MultiGet` with a `strict_capacity_limit` set. Before the change, half of my unit test cases failed https://github.com/facebook/rocksdb/actions/runs/11604597524/job/32313608085?pr=13104. After I added the check for the status returned by `MaybeReadBlockAndLoadToCache`, they all pass. I also ran these tests manually (I had to run `make clean` before): ``` make -j64 block_based_table_reader_test COMPILE_WITH_ASAN=1 ASSERT_STATUS_CHECKED=1 ./block_based_table_reader_test --gtest_filter="*StrictCapacityLimitReaderTest.Get*" ./block_based_table_reader_test --gtest_filter="*StrictCapacityLimitReaderTest.MultiGet*" ``` Reviewed By: anand1976 Differential Revision: D65302470 Pulled By: archang19 fbshipit-source-id: 28dcc381e67e05a89fa9fc9607b4709976d6d90e |
||
---|---|---|
.. | ||
adaptive | ||
block_based | ||
cuckoo | ||
plain | ||
block_fetcher.cc | ||
block_fetcher.h | ||
block_fetcher_test.cc | ||
cleanable_test.cc | ||
compaction_merging_iterator.cc | ||
compaction_merging_iterator.h | ||
format.cc | ||
format.h | ||
get_context.cc | ||
get_context.h | ||
internal_iterator.h | ||
iter_heap.h | ||
iterator.cc | ||
iterator_wrapper.h | ||
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 | ||
sst_file_dumper.cc | ||
sst_file_dumper.h | ||
sst_file_reader.cc | ||
sst_file_reader_test.cc | ||
sst_file_writer.cc | ||
sst_file_writer_collectors.h | ||
table_builder.h | ||
table_factory.cc | ||
table_iterator.h | ||
table_properties.cc | ||
table_properties_internal.h | ||
table_reader.h | ||
table_reader_bench.cc | ||
table_test.cc | ||
two_level_iterator.cc | ||
two_level_iterator.h | ||
unique_id.cc | ||
unique_id_impl.h |