rocksdb/cache
Peter Dillinger ef6f025563 Placeholder for AutoHyperClockCache, more (#11692)
Summary:
* The plan is for AutoHyperClockCache to be selected when HyperClockCacheOptions::estimated_entry_charge == 0, and in that case to use a new configuration option min_avg_entry_charge for determining an extreme case maximum size for the hash table. For the placeholder, a hack is in place in HyperClockCacheOptions::MakeSharedCache() to make the unit tests happy despite the new options not really making sense with the current implementation.
* Mostly updating and refactoring tests to test both the current HCC (internal name FixedHyperClockCache) and a placeholder for the new version (internal name AutoHyperClockCache).
* Simplify some existing tests not to depend directly on cache type.
* Type-parameterize the shard-level unit tests, which unfortunately requires more syntax like `this->` in places for disambiguation.
* Added means of choosing auto_hyper_clock_cache to cache_bench, db_bench, and db_stress, including add to crash test.
* Add another templated class BaseHyperClockCache to reduce future copy-paste
* Added ReportProblems support to cache_bench
* Added a DEBUG-level diagnostic to ReportProblems for the variance in load factor throughout the table, which will become more of a concern with linear hashing to be used in the Auto implementation. Example with current Fixed HCC:
```
2023/08/10-13:41:41.602450 6ac36 [DEBUG] [che/clock_cache.cc:1507] Slot occupancy stats: Overall 49% (129008/262144), Min/Max/Window = 39%/60%/500, MaxRun{Pos/Neg} = 18/17
```

In other words, with overall occupancy of 49%, the lowest across any 500 contiguous cells is 39% and highest 60%. Longest run of occupied is 18 and longest run of unoccupied is 17. This seems consistent with random samples from a uniform distribution.

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

Test Plan: Shouldn't be any meaningful changes yet to production code or to what is tested, but there is temporary redundancy in testing until the new implementation is plugged in.

Reviewed By: jowlyzhang

Differential Revision: D48247413

Pulled By: pdillinger

fbshipit-source-id: 11541f996d97af403c2e43c92fb67ff22dd0b5da
2023-08-11 16:27:38 -07:00
..
cache.cc
cache_bench.cc
cache_bench_tool.cc Placeholder for AutoHyperClockCache, more (#11692) 2023-08-11 16:27:38 -07: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
cache_test.cc Placeholder for AutoHyperClockCache, more (#11692) 2023-08-11 16:27:38 -07:00
charged_cache.cc
charged_cache.h
clock_cache.cc Placeholder for AutoHyperClockCache, more (#11692) 2023-08-11 16:27:38 -07:00
clock_cache.h Placeholder for AutoHyperClockCache, more (#11692) 2023-08-11 16:27:38 -07:00
compressed_secondary_cache.cc Integrate CacheReservationManager with compressed secondary cache (#11449) 2023-05-30 14:05:48 -07:00
compressed_secondary_cache.h Integrate CacheReservationManager with compressed secondary cache (#11449) 2023-05-30 14:05:48 -07:00
compressed_secondary_cache_test.cc Prepare tests for new HCC naming (#11676) 2023-08-07 18:17:12 -07:00
lru_cache.cc Prepare for specialized interface for row cache (#11620) 2023-07-18 19:12:58 -07:00
lru_cache.h
lru_cache_test.cc Placeholder for AutoHyperClockCache, more (#11692) 2023-08-11 16:27:38 -07:00
secondary_cache.cc
secondary_cache_adapter.cc Update secondary_cache_adapter.cc (#11566) 2023-06-27 10:42:42 -07:00
secondary_cache_adapter.h Integrate CacheReservationManager with compressed secondary cache (#11449) 2023-05-30 14:05:48 -07:00
sharded_cache.cc Add some more bit operations to internal APIs (#11660) 2023-08-02 11:30:10 -07:00
sharded_cache.h Placeholder for AutoHyperClockCache, more (#11692) 2023-08-11 16:27:38 -07:00
typed_cache.h