rocksdb/test_util
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
..
mock_time_env.cc Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
mock_time_env.h Add seqno to time mapping (#10338) 2022-07-14 21:49:34 -07:00
secondary_cache_test_util.cc HyperClockCache support for SecondaryCache, with refactoring (#11301) 2023-03-17 20:23:49 -07:00
secondary_cache_test_util.h Placeholder for AutoHyperClockCache, more (#11692) 2023-08-11 16:27:38 -07:00
sync_point.cc clang format files under test_util/ (#10855) 2022-10-24 20:32:25 -07:00
sync_point.h Document SyncPoint::LoadDependency (#11477) 2023-05-24 16:49:17 -07:00
sync_point_impl.cc clang format files under test_util/ (#10855) 2022-10-24 20:32:25 -07:00
sync_point_impl.h clang format files under test_util/ (#10855) 2022-10-24 20:32:25 -07:00
testharness.cc clang format files under test_util/ (#10855) 2022-10-24 20:32:25 -07:00
testharness.h Changes and enhancements to compression stats, thresholds (#11388) 2023-04-21 21:57:40 -07:00
testutil.cc format_version=6 and context-aware block checksums (#9058) 2023-07-30 16:40:01 -07:00
testutil.h Add a UDT comparator for ReverseBytewiseComparator to object library (#11647) 2023-07-27 15:31:22 -07:00
testutil_test.cc More Makefile Cleanup (#7097) 2020-07-09 14:35:17 -07:00
transaction_test_util.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
transaction_test_util.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00