diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index f8fd1e5dcc..f04bc672af 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -3028,6 +3028,7 @@ void InitializeOptionsFromFlags( static_cast(FLAGS_compaction_style); options.compaction_pri = static_cast(FLAGS_compaction_pri); + options.num_levels = FLAGS_num_levels; if (FLAGS_prefix_size >= 0) { options.prefix_extractor.reset(NewFixedPrefixTransform(FLAGS_prefix_size)); } diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 048fffc818..bc17a01152 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -759,7 +759,7 @@ def whitebox_crash_main(args, unknown_args): check_mode = 0 kill_random_test = cmd_params["random_kill_odd"] kill_mode = 0 - + prev_compaction_style = -1 while time.time() < exit_time: if check_mode == 0: additional_opts = { @@ -833,6 +833,12 @@ def whitebox_crash_main(args, unknown_args): "ops_per_thread": cmd_params["ops_per_thread"], } + cur_compaction_style = additional_opts.get("compaction_style", cmd_params.get("compaction_style", 0)) + if prev_compaction_style != -1 and prev_compaction_style != cur_compaction_style: + print("`compaction_style` is changed in current run so `destroy_db_initially` is set to 1 as a short-term solution to avoid cycling through previous db of different compaction style." + "\n") + additional_opts["destroy_db_initially"] = 1 + prev_compaction_style = cur_compaction_style + cmd = gen_cmd( dict( list(cmd_params.items())