Skip to content

Commit

Permalink
destroy_db_initially=1 when run with different compaction_style for p…
Browse files Browse the repository at this point in the history
…rev run
  • Loading branch information
hx235 committed Sep 27, 2022
1 parent 613ee69 commit f56d841
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/db_crashtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit f56d841

Please sign in to comment.