Do not adjust test_batches_snapshots to avoid mixing runs (#10830)

Summary:
This is a small follow-up to https://github.com/facebook/rocksdb/pull/10821. The goal of that PR was to hold `test_batches_snapshots` fixed across all `db_stress` invocations; however, that patch didn't address the case when `test_batches_snapshots` is unset due to a conflicting `enable_compaction_filter` or `prefix_size` setting. This PR updates the logic so the other parameter is sanitized instead in the case of such conflicts.

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

Reviewed By: riversand963

Differential Revision: D40444548

Pulled By: ltamasi

fbshipit-source-id: 0331265704904b729262adec37139292fcbb7805
This commit is contained in:
Levi Tamasi 2022-10-17 14:32:59 -07:00 committed by Facebook GitHub Bot
parent 8142223b1b
commit 11c0d1310e
1 changed files with 5 additions and 2 deletions

View File

@ -515,6 +515,11 @@ def finalize_and_sanitize(src_params):
else:
dest_params["mock_direct_io"] = True
if dest_params["test_batches_snapshots"] == 1:
dest_params["enable_compaction_filter"] = 0
if dest_params["prefix_size"] < 0:
dest_params["prefix_size"] = 1
# Multi-key operations are not currently compatible with transactions or
# timestamp.
if (dest_params.get("test_batches_snapshots") == 1 or
@ -577,11 +582,9 @@ def finalize_and_sanitize(src_params):
# Give the iterator ops away to reads.
dest_params["readpercent"] += dest_params.get("iterpercent", 10)
dest_params["iterpercent"] = 0
dest_params["test_batches_snapshots"] = 0
if dest_params.get("prefix_size") == -1:
dest_params["readpercent"] += dest_params.get("prefixpercent", 20)
dest_params["prefixpercent"] = 0
dest_params["test_batches_snapshots"] = 0
if (
dest_params.get("prefix_size") == -1
and dest_params.get("memtable_whole_key_filtering") == 0