rocksdb/cache
Peter Dillinger 5fa6ef7f18 Fix fragile CacheTest::ApplyToAllEntriesDuringResize (#10145)
Summary:
As seen in https://github.com/facebook/rocksdb/issues/10137, simply churning the cache key hashes (e.g.
by changing the raw cache keys) could trigger failure in this test, due
to possibility of some cache shard exceeding its portion of capacity
and evicting entries. Updated the test to be less fragile by using
greater margins, and added a pre-check for evictions, which doesn't
manifest as a race condition, before the main check that can race.

Also added stack trace handler to cache_test for debugging.

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

Test Plan:
test thousands of iterations with gtest-parallel, including
with changes in https://github.com/facebook/rocksdb/issues/10137 that were surfacing the problem. Pre-check
without the fix would always fail with https://github.com/facebook/rocksdb/issues/10137

Reviewed By: guidotag

Differential Revision: D37058771

Pulled By: pdillinger

fbshipit-source-id: a7cf137967aef49c07ae9602d8523c63e7388fab
2022-06-09 19:43:19 -07:00
..
cache.cc
cache_bench.cc
cache_bench_tool.cc Add support for FastLRUCache in cache_bench (#10095) 2022-06-03 13:40:09 -07:00
cache_entry_roles.cc Expose CacheEntryRole and map keys for block cache stat collections (#9838) 2022-04-14 09:38:55 -07:00
cache_entry_roles.h Expose CacheEntryRole and map keys for block cache stat collections (#9838) 2022-04-14 09:38:55 -07:00
cache_entry_stats.h New stable, fixed-length cache keys (#9126) 2021-12-16 17:15:13 -08:00
cache_helpers.h
cache_key.cc Enhance new cache key testing & comments (#9329) 2022-02-04 14:15:58 -08:00
cache_key.h New stable, fixed-length cache keys (#9126) 2021-12-16 17:15:13 -08:00
cache_reservation_manager.cc Account memory of big memory users in BlockBasedTable in global memory limit (#9748) 2022-04-06 10:33:00 -07:00
cache_reservation_manager.h Account memory of big memory users in BlockBasedTable in global memory limit (#9748) 2022-04-06 10:33:00 -07:00
cache_reservation_manager_test.cc Meta-internal folly integration with F14FastMap (#9546) 2022-04-13 07:34:01 -07:00
cache_test.cc Fix fragile CacheTest::ApplyToAllEntriesDuringResize (#10145) 2022-06-09 19:43:19 -07:00
clock_cache.cc Update Cache::Release param from force_erase to erase_if_last_ref (#9728) 2022-03-22 10:22:18 -07:00
clock_cache.h
compressed_secondary_cache.cc Prevent double caching in the compressed secondary cache (#9747) 2022-04-11 13:28:33 -07:00
compressed_secondary_cache.h Prevent double caching in the compressed secondary cache (#9747) 2022-04-11 13:28:33 -07:00
compressed_secondary_cache_test.cc Prevent double caching in the compressed secondary cache (#9747) 2022-04-11 13:28:33 -07:00
fast_lru_cache.cc Avoid malloc_usable_size() call inside LRU Cache mutex (#10026) 2022-05-24 13:31:16 -07:00
fast_lru_cache.h Avoid malloc_usable_size() call inside LRU Cache mutex (#10026) 2022-05-24 13:31:16 -07:00
lru_cache.cc Avoid malloc_usable_size() call inside LRU Cache mutex (#10026) 2022-05-24 13:31:16 -07:00
lru_cache.h Avoid malloc_usable_size() call inside LRU Cache mutex (#10026) 2022-05-24 13:31:16 -07:00
lru_cache_test.cc Prevent double caching in the compressed secondary cache (#9747) 2022-04-11 13:28:33 -07:00
sharded_cache.cc Update Cache::Release param from force_erase to erase_if_last_ref (#9728) 2022-03-22 10:22:18 -07:00
sharded_cache.h Update Cache::Release param from force_erase to erase_if_last_ref (#9728) 2022-03-22 10:22:18 -07:00