Fix/expand prefix extractor testing in crash test (#9461)

Summary:
Changes in https://github.com/facebook/rocksdb/issues/9453 could trigger
```
stderr:
Error: prefixpercent is non-zero while prefix_size is not positive!
```

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9461

Test Plan: run `make blackbox_crashtest` for a long time

Reviewed By: ajkr

Differential Revision: D33830751

Pulled By: pdillinger

fbshipit-source-id: be88377dcaa47e4bb7adb0347762639eff8f1476
main
Peter Dillinger 3 years ago committed by Facebook GitHub Bot
parent 78aee6fedc
commit 981e8c621f
  1. 7
      tools/db_crashtest.py

@ -87,7 +87,7 @@ default_params = {
"partition_filters": lambda: random.randint(0, 1), "partition_filters": lambda: random.randint(0, 1),
"partition_pinning": lambda: random.randint(0, 3), "partition_pinning": lambda: random.randint(0, 3),
"pause_background_one_in": 1000000, "pause_background_one_in": 1000000,
"prefix_size" : -1, "prefix_size" : lambda: random.choice([-1, 1, 5, 7, 8]),
"prefixpercent": 5, "prefixpercent": 5,
"progress_reports": 0, "progress_reports": 0,
"readpercent": 45, "readpercent": 45,
@ -243,8 +243,6 @@ simple_default_params = {
"max_background_compactions": 1, "max_background_compactions": 1,
"max_bytes_for_level_base": 67108864, "max_bytes_for_level_base": 67108864,
"memtablerep": "skip_list", "memtablerep": "skip_list",
"prefixpercent": 0,
"readpercent": 50,
"target_file_size_base": 16777216, "target_file_size_base": 16777216,
"target_file_size_multiplier": 1, "target_file_size_multiplier": 1,
"test_batches_snapshots": 0, "test_batches_snapshots": 0,
@ -406,6 +404,9 @@ def finalize_and_sanitize(src_params):
if (dest_params.get("prefix_size") == -1 and if (dest_params.get("prefix_size") == -1 and
dest_params.get("memtable_whole_key_filtering") == 0): dest_params.get("memtable_whole_key_filtering") == 0):
dest_params["memtable_prefix_bloom_size_ratio"] = 0 dest_params["memtable_prefix_bloom_size_ratio"] = 0
if dest_params.get("prefix_size") == -1:
dest_params["readpercent"] += dest_params.get("prefixpercent", 20)
dest_params["prefixpercent"] = 0
return dest_params return dest_params
def gen_cmd_params(args): def gen_cmd_params(args):

Loading…
Cancel
Save