summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib
diff options
context:
space:
mode:
authorReo Kimura <reo.kimura@mongodb.com>2021-10-15 18:29:46 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-15 19:55:24 +0000
commit05212043b17f6de00b8afa818e974f8064e473c2 (patch)
tree49543ec368dfd39baaa8d9a0c6e8cd9bf95c4852 /buildscripts/resmokelib
parentdb3f81f7f409688b537ccdcf0d7212a8fd7c5d2c (diff)
downloadmongo-05212043b17f6de00b8afa818e974f8064e473c2.tar.gz
SERVER-59833 Expand WT config fuzzing in mongod for collections and indexes
Diffstat (limited to 'buildscripts/resmokelib')
-rw-r--r--buildscripts/resmokelib/configure_resmoke.py17
-rw-r--r--buildscripts/resmokelib/mongod_fuzzer_configs.py25
2 files changed, 35 insertions, 7 deletions
diff --git a/buildscripts/resmokelib/configure_resmoke.py b/buildscripts/resmokelib/configure_resmoke.py
index 06fe4b479d3..34eb2295b2e 100644
--- a/buildscripts/resmokelib/configure_resmoke.py
+++ b/buildscripts/resmokelib/configure_resmoke.py
@@ -250,8 +250,9 @@ def _update_config_vars(values): # pylint: disable=too-many-statements,too-many
_config.CONFIG_FUZZ_SEED = random.randrange(sys.maxsize)
else:
_config.CONFIG_FUZZ_SEED = int(_config.CONFIG_FUZZ_SEED)
- _config.MONGOD_SET_PARAMETERS, _config.WT_ENGINE_CONFIG = mongod_fuzzer_configs \
- .fuzz_set_parameters(_config.CONFIG_FUZZ_SEED, _config.MONGOD_SET_PARAMETERS)
+ _config.MONGOD_SET_PARAMETERS, _config.WT_ENGINE_CONFIG, _config.WT_COLL_CONFIG, \
+ _config.WT_INDEX_CONFIG = mongod_fuzzer_configs.fuzz_set_parameters(
+ _config.CONFIG_FUZZ_SEED, _config.MONGOD_SET_PARAMETERS)
_config.MONGOS_EXECUTABLE = _expand_user(config.pop("mongos_executable"))
@@ -324,12 +325,16 @@ def _update_config_vars(values): # pylint: disable=too-many-statements,too-many
_config.ARCHIVE_LIMIT_MB = config.pop("archive_limit_mb")
_config.ARCHIVE_LIMIT_TESTS = config.pop("archive_limit_tests")
- # Wiredtiger options.
- _config.WT_COLL_CONFIG = config.pop("wt_coll_config")
+ # Wiredtiger options. Prevent fuzzed wt configs from being overwritten unless user specifies it.
wt_engine_config = config.pop("wt_engine_config")
- if wt_engine_config: # prevents fuzzed wt_engine_config from being overwritten unless user specifies it
+ if wt_engine_config:
_config.WT_ENGINE_CONFIG = config.pop("wt_engine_config")
- _config.WT_INDEX_CONFIG = config.pop("wt_index_config")
+ wt_coll_config = config.pop("wt_coll_config")
+ if wt_coll_config:
+ _config.WT_COLL_CONFIG = config.pop("wt_coll_config")
+ wt_index_config = config.pop("wt_index_config")
+ if wt_index_config:
+ _config.WT_INDEX_CONFIG = config.pop("wt_index_config")
# Benchmark/Benchrun options.
_config.BENCHMARK_FILTER = config.pop("benchmark_filter")
diff --git a/buildscripts/resmokelib/mongod_fuzzer_configs.py b/buildscripts/resmokelib/mongod_fuzzer_configs.py
index e0a3beff643..1772633d900 100644
--- a/buildscripts/resmokelib/mongod_fuzzer_configs.py
+++ b/buildscripts/resmokelib/mongod_fuzzer_configs.py
@@ -34,6 +34,28 @@ def generate_eviction_configs(rng):
close_scan_interval)
+def generate_table_configs(rng):
+ """Generate random configurations for wiredTigerCollectionConfigString parameter."""
+
+ # TODO(SERVER-60747): Add fuzzing for leaf_page_max
+
+ internal_page_max = rng.choice([4, 8, 12, 1024, 10 * 1024]) * 1024
+ leaf_value_max = rng.choice([1, 32, 128, 256]) * 1024 * 1024
+
+ memory_page_max_lower_bound = 16 * 1024 # leaf_page_max
+ # Assume WT cache size of 1GB as most MDB tests specify this as the cache size
+ memory_page_max_upper_bound = (rng.randint(256, 1024) * 1024 * 1024) / 10 # cache_size / 10
+ memory_page_max = rng.randint(memory_page_max_lower_bound, memory_page_max_upper_bound)
+
+ split_pct = rng.choice([50, 60, 75, 100])
+ prefix_compression = rng.choice(["true", "false"])
+ block_compressor = rng.choice(["none", "snappy", "zlib", "zstd"])
+
+ return "block_compressor={0},internal_page_max={1},leaf_value_max={2},memory_page_max={3},"\
+ "prefix_compression={4},split_pct={5}".format(block_compressor, internal_page_max, leaf_value_max,
+ memory_page_max, prefix_compression, split_pct)
+
+
def generate_flow_control_parameters(rng):
"""Generate parameters related to flow control and returns a dictionary."""
configs = {}
@@ -78,4 +100,5 @@ def fuzz_set_parameters(seed, user_provided_params):
for key, value in utils.load_yaml(user_provided_params).items():
ret[key] = value
- return utils.dump_yaml(ret), generate_eviction_configs(rng)
+ return utils.dump_yaml(ret), generate_eviction_configs(rng), generate_table_configs(rng), \
+ generate_table_configs(rng)