diff options
author | Hui Xiao <huixiao@fb.com> | 2024-04-11 14:53:11 -0700 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2024-04-11 14:53:11 -0700 |
commit | ef26d68e8d027042344a093952b1fa599ac2ac30 (patch) | |
tree | 4924e958fa7872497f75e13df8db0cbb3e31ee7d /db_stress_tool | |
parent | 85925051c780460df5d72b3e7e3bd3e001e5287f (diff) |
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
Diffstat (limited to 'db_stress_tool')
-rw-r--r-- | db_stress_tool/db_stress_test_base.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index c426cce16..a503da154 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -192,7 +192,6 @@ std::shared_ptr<Cache> StressTest::NewCache(size_t capacity, static_cast<TieredAdmissionPolicy>(FLAGS_adm_policy); if (tiered_opts.adm_policy == TieredAdmissionPolicy::kAdmPolicyThreeQueue) { - std::shared_ptr<SecondaryCache> nvm_sec_cache; CompressedSecondaryCacheOptions nvm_sec_cache_opts; nvm_sec_cache_opts.capacity = cache_size; 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.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); } else { opts.secondary_cache = std::move(secondary_cache); |