rocksdb/cache
anand76 0ae3d9f98d Fix stale memory access with FSBuffer and tiered sec cache (#12712)
Summary:
A `BlockBasedTable` with `TieredSecondaryCache` containing a NVM cache inserts blocks  into the compressed cache and the corresponding compressed block into the NVM cache.  The `BlockFetcher` is used to get the uncompressed and compressed blocks by calling `ReadBlockContents()` and `GetUncompressedBlock()` respectively. If the file system supports FSBuffer (i.e returning a FS allocated buffer rather than caller provided), that buffer gets freed between the two calls. This PR fixes it by making the FSBuffer unique pointer a member rather than local variable.

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

Test Plan:
1. Add a unit test
2. Release validation stress test

Reviewed By: jaykorean

Differential Revision: D57974026

Pulled By: anand1976

fbshipit-source-id: cfa895914e74b4f628413b40e6e39d8d8e5286bd
2024-05-30 12:33:58 -07:00
..
cache.cc
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
cache_helpers.cc
cache_helpers.h
cache_key.cc
cache_key.h
cache_reservation_manager.cc
cache_reservation_manager.h
cache_reservation_manager_test.cc Remove extra semi colon from icsp/lib/logging/IcspLogRpcMessage.cpp 2024-03-31 10:26:34 -07:00
cache_test.cc Run internal cpp modernizer on RocksDB repo (#12398) 2024-03-04 10:08:32 -08:00
charged_cache.cc
charged_cache.h
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
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
secondary_cache_adapter.cc Implement secondary cache admission policy to allow all evicted blocks (#12599) 2024-05-02 11:23:35 -07:00
secondary_cache_adapter.h
sharded_cache.cc
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
tiered_secondary_cache.h Remove 'virtual' when implied by 'override' (#12319) 2024-01-31 13:14:42 -08:00
tiered_secondary_cache_test.cc Fix stale memory access with FSBuffer and tiered sec cache (#12712) 2024-05-30 12:33:58 -07:00
typed_cache.h Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00