rocksdb/cache
Guido Tagliavini Ponce b52620ab0e Fix key size in cache_bench (#10234)
Summary:
cache_bench wasn't generating 16B keys, which are necessary for FastLRUCache. Also:
- Added asserts in cache_bench, which is assuming that inserts never fail. When they fail (for example, if we used keys of the wrong size), memory allocated to the values will becomes leaked, and eventually the program crashes.
- Move kCacheKeySize to the right spot.

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

Test Plan:
``make -j24 check``. Also, run cache_bench with FastLRUCache and check that memory usage doesn't blow up:
``./cache_bench -cache_type=fast_lru_cache -num_shard_bits=6 -skewed=true \
                        -lookup_insert_percent=100 -lookup_percent=0 -insert_percent=0 -erase_percent=0 \
                        -populate_cache=true -cache_size=1073741824 -ops_per_thread=10000000 \
                        -value_bytes=8192 -resident_ratio=1 -threads=16``

Reviewed By: pdillinger

Differential Revision: D37382949

Pulled By: guidotag

fbshipit-source-id: b697a942ebb215de5d341f98dc8566763436ba9b
2022-06-23 11:26:50 -07:00
..
cache.cc Enable SecondaryCache::CreateFromString to create sec cache based on the uri for CompressedSecondaryCache (#10132) 2022-06-10 12:23:10 -07:00
cache_bench.cc Add (& fix) some simple source code checks (#8821) 2021-09-07 21:19:27 -07:00
cache_bench_tool.cc Fix key size in cache_bench (#10234) 2022-06-23 11:26:50 -07:00
cache_entry_roles.cc Account memory of FileMetaData in global memory limit (#9924) 2022-06-14 13:06:40 -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 Use deleters to label cache entries and collect stats (#8297) 2021-05-19 16:51:13 -07:00
cache_key.cc Enhance new cache key testing & comments (#9329) 2022-02-04 14:15:58 -08:00
cache_key.h Fix key size in cache_bench (#10234) 2022-06-23 11:26:50 -07:00
cache_reservation_manager.cc Account memory of FileMetaData in global memory limit (#9924) 2022-06-14 13:06:40 -07:00
cache_reservation_manager.h Account memory of FileMetaData in global memory limit (#9924) 2022-06-14 13:06:40 -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 Replace per-shard chained hash tables with open-addressing scheme (#10194) 2022-06-21 08:45:04 -07:00
clock_cache.cc Use optimized folly DistributedMutex in LRUCache when available (#10179) 2022-06-17 13:08:45 -07:00
clock_cache.h Change RocksDB License 2017-07-15 16:11:23 -07:00
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 Enable SecondaryCache::CreateFromString to create sec cache based on the uri for CompressedSecondaryCache (#10132) 2022-06-10 12:23:10 -07:00
fast_lru_cache.cc Replace per-shard chained hash tables with open-addressing scheme (#10194) 2022-06-21 08:45:04 -07:00
fast_lru_cache.h Fix key size in cache_bench (#10234) 2022-06-23 11:26:50 -07:00
lru_cache.cc Use optimized folly DistributedMutex in LRUCache when available (#10179) 2022-06-17 13:08:45 -07:00
lru_cache.h Use optimized folly DistributedMutex in LRUCache when available (#10179) 2022-06-17 13:08:45 -07:00
lru_cache_test.cc Make the per-shard hash table fixed-size. (#10154) 2022-06-13 20:29:00 -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