rocksdb/cache
Changyu Bi f77b788545 Fix a bug in LRUCacheShard::LRU_Insert (#12429)
Summary:
we saw crash test fail with
```
lru_cache.cc:249: void rocksdb::lru_cache::LRUCacheShard::LRU_Remove(rocksdb::lru_cache::LRUHandle *): Assertion `high_pri_pool_usage_ >= e->total_charge' failed.
```
One cause for this is that `lru_low_pri_` pointer is not updated in `LRU_insert()` before we try to balance high pri and low pri pool in `MaintainPoolSize();`. A repro unit test is provided.

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

Test Plan:
Not able to reproduce the failure with db_stress yet.
`./lru_cache_test --gtest_filter="*InsertAfterReducingCapacity*`. It fails the assertion before this PR.

Reviewed By: pdillinger

Differential Revision: D54908919

Pulled By: cbi42

fbshipit-source-id: f485fdbc0ea61c8092a0be5fe561a59c15c78fd3
2024-03-14 14:58:30 -07:00
..
cache.cc Support compressed and local flash secondary cache stacking (#11812) 2023-09-21 20:30:53 -07:00
cache_bench.cc
cache_bench_tool.cc Run internal cpp modernizer on RocksDB repo (#12398) 2024-03-04 10:08:32 -08:00
cache_entry_roles.cc
cache_entry_roles.h
cache_entry_stats.h Simplify tracking entries already in SecondaryCache (#11299) 2023-03-15 17:51:44 -07:00
cache_helpers.cc Support compressed and local flash secondary cache stacking (#11812) 2023-09-21 20:30:53 -07:00
cache_helpers.h Put Cache and CacheWrapper in new public header (#11192) 2023-02-09 12:12:02 -08:00
cache_key.cc Put Cache and CacheWrapper in new public header (#11192) 2023-02-09 12:12:02 -08:00
cache_key.h
cache_reservation_manager.cc Simplify tracking entries already in SecondaryCache (#11299) 2023-03-15 17:51:44 -07:00
cache_reservation_manager.h Fix updating the capacity of a tiered cache (#11873) 2023-09-22 18:07:46 -07:00
cache_reservation_manager_test.cc
cache_test.cc Run internal cpp modernizer on RocksDB repo (#12398) 2024-03-04 10:08:32 -08:00
charged_cache.cc Support compressed and local flash secondary cache stacking (#11812) 2023-09-21 20:30:53 -07:00
charged_cache.h Support compressed and local flash secondary cache stacking (#11812) 2023-09-21 20:30:53 -07:00
clock_cache.cc Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00
clock_cache.h Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00
compressed_secondary_cache.cc Run internal cpp modernizer on RocksDB repo (#12398) 2024-03-04 10:08:32 -08:00
compressed_secondary_cache.h Add some compressed and tiered secondary cache stats (#12150) 2023-12-15 11:34:08 -08:00
compressed_secondary_cache_test.cc Run internal cpp modernizer on RocksDB repo (#12398) 2024-03-04 10:08:32 -08:00
lru_cache.cc Fix a bug in LRUCacheShard::LRU_Insert (#12429) 2024-03-14 14:58:30 -07:00
lru_cache.h Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00
lru_cache_test.cc Fix a bug in LRUCacheShard::LRU_Insert (#12429) 2024-03-14 14:58:30 -07:00
secondary_cache.cc Support compressed and local flash secondary cache stacking (#11812) 2023-09-21 20:30:53 -07:00
secondary_cache_adapter.cc Add some compressed and tiered secondary cache stats (#12150) 2023-12-15 11:34:08 -08:00
secondary_cache_adapter.h Make CacheWithSecondaryAdapter reservation accounting more robust (#12059) 2023-11-14 16:25:52 -08:00
sharded_cache.cc Add APIs to query secondary cache capacity and usage for TieredCache (#12011) 2023-10-25 16:54:50 -07:00
sharded_cache.h Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00
tiered_secondary_cache.cc Add some compressed and tiered secondary cache stats (#12150) 2023-12-15 11:34:08 -08:00
tiered_secondary_cache.h Remove 'virtual' when implied by 'override' (#12319) 2024-01-31 13:14:42 -08:00
tiered_secondary_cache_test.cc Run internal cpp modernizer on RocksDB repo (#12398) 2024-03-04 10:08:32 -08:00
typed_cache.h Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00