mirror of https://github.com/facebook/rocksdb.git
Renable kAdmPolicyThreeQueue in crash test (#12524)
Summary: Context/Summary: We need a `nvm_sec_cache` when `kAdmPolicyThreeQueue` is used otherwise a nullptr cache will be accessed causing us segfault in https://github.com/facebook/rocksdb/pull/12521 Pull Request resolved: https://github.com/facebook/rocksdb/pull/12524 Test Plan: - Re-enabled `kAdmPolicyThreeQueue` and rehearsed stress test that failed before this fix and pass after Reviewed By: jowlyzhang Differential Revision: D55997093 Pulled By: hx235 fbshipit-source-id: e1c6f1015091b4cff0ce6a3fff981d5dece52a62
This commit is contained in:
parent
85925051c7
commit
ef26d68e8d
|
@ -192,7 +192,6 @@ std::shared_ptr<Cache> StressTest::NewCache(size_t capacity,
|
||||||
static_cast<TieredAdmissionPolicy>(FLAGS_adm_policy);
|
static_cast<TieredAdmissionPolicy>(FLAGS_adm_policy);
|
||||||
if (tiered_opts.adm_policy ==
|
if (tiered_opts.adm_policy ==
|
||||||
TieredAdmissionPolicy::kAdmPolicyThreeQueue) {
|
TieredAdmissionPolicy::kAdmPolicyThreeQueue) {
|
||||||
std::shared_ptr<SecondaryCache> nvm_sec_cache;
|
|
||||||
CompressedSecondaryCacheOptions nvm_sec_cache_opts;
|
CompressedSecondaryCacheOptions nvm_sec_cache_opts;
|
||||||
nvm_sec_cache_opts.capacity = cache_size;
|
nvm_sec_cache_opts.capacity = cache_size;
|
||||||
tiered_opts.nvm_sec_cache =
|
tiered_opts.nvm_sec_cache =
|
||||||
|
@ -220,6 +219,13 @@ std::shared_ptr<Cache> StressTest::NewCache(size_t capacity,
|
||||||
tiered_opts.compressed_secondary_ratio = 0.5;
|
tiered_opts.compressed_secondary_ratio = 0.5;
|
||||||
tiered_opts.adm_policy =
|
tiered_opts.adm_policy =
|
||||||
static_cast<TieredAdmissionPolicy>(FLAGS_adm_policy);
|
static_cast<TieredAdmissionPolicy>(FLAGS_adm_policy);
|
||||||
|
if (tiered_opts.adm_policy ==
|
||||||
|
TieredAdmissionPolicy::kAdmPolicyThreeQueue) {
|
||||||
|
CompressedSecondaryCacheOptions nvm_sec_cache_opts;
|
||||||
|
nvm_sec_cache_opts.capacity = cache_size;
|
||||||
|
tiered_opts.nvm_sec_cache =
|
||||||
|
NewCompressedSecondaryCache(nvm_sec_cache_opts);
|
||||||
|
}
|
||||||
block_cache = NewTieredCache(tiered_opts);
|
block_cache = NewTieredCache(tiered_opts);
|
||||||
} else {
|
} else {
|
||||||
opts.secondary_cache = std::move(secondary_cache);
|
opts.secondary_cache = std::move(secondary_cache);
|
||||||
|
|
|
@ -273,9 +273,7 @@ default_params = {
|
||||||
"block_align": 0,
|
"block_align": 0,
|
||||||
"lowest_used_cache_tier": lambda: random.choice([0, 1, 2]),
|
"lowest_used_cache_tier": lambda: random.choice([0, 1, 2]),
|
||||||
"enable_custom_split_merge": lambda: random.choice([0, 1]),
|
"enable_custom_split_merge": lambda: random.choice([0, 1]),
|
||||||
# TODO(hx235): enable `kAdmPolicyThreeQueue` after fixing the surfaced segfault
|
"adm_policy": lambda: random.choice([0, 1, 2, 3]),
|
||||||
# issue in CompressedCacheSetCapacityThread
|
|
||||||
"adm_policy": lambda: random.choice([0, 1, 2]),
|
|
||||||
"last_level_temperature": lambda: random.choice(["kUnknown", "kHot", "kWarm", "kCold"]),
|
"last_level_temperature": lambda: random.choice(["kUnknown", "kHot", "kWarm", "kCold"]),
|
||||||
"default_write_temperature": lambda: random.choice(["kUnknown", "kHot", "kWarm", "kCold"]),
|
"default_write_temperature": lambda: random.choice(["kUnknown", "kHot", "kWarm", "kCold"]),
|
||||||
"default_temperature": lambda: random.choice(["kUnknown", "kHot", "kWarm", "kCold"]),
|
"default_temperature": lambda: random.choice(["kUnknown", "kHot", "kWarm", "kCold"]),
|
||||||
|
|
Loading…
Reference in New Issue