diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index ee9baddfd7d..95aa7509fa8 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -548,6 +548,13 @@ void StressTest::PreloadDbAndReopenAsReadOnly(int64_t number_of_keys, Status StressTest::SetOptions(ThreadState* thread) { assert(FLAGS_set_options_one_in > 0); + if (thread->rand.Next() % 4 == 0) { + // Configuring an options structure can reprepare its member option objects + // that are not explicitly changed. Cover that here with 1/4 chance. If this + // behavior changes in the future we can remove this. + Options copy_options(options_); + return GetOptionsFromString(options_, "", ©_options); + } std::unordered_map opts; std::string name = options_index_[thread->rand.Next() % options_index_.size()];