From 6123611c420a8b1f436fe9c7b2fba245a41faa4d Mon Sep 17 00:00:00 2001 From: sdong Date: Thu, 14 Nov 2019 13:59:43 -0800 Subject: [PATCH] crash_test: use large max_manifest_file_size most of the time. (#6034) Summary: Right now, crash_test always uses 16KB max_manifest_file_size value. It is good to cover logic of manifest file switch. However, information stored in manifest files might be useful in debugging failures. Switch to only use small manifest file size in 1/15 of the time. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6034 Test Plan: Observe command generated by db_crash_test.py multiple times and see the --max_manifest_file_size value distribution. Differential Revision: D18513824 fbshipit-source-id: 7b3ae6dbe521a0918df41064e3fa5ecbf2466e04 --- tools/db_crashtest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 0716fdb2b..e88f94920 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -72,6 +72,10 @@ default_params = { "periodic_compaction_seconds" : lambda: random.choice([0, 0, 1, 2, 10, 100, 1000]), "compaction_ttl" : lambda: random.choice([0, 0, 1, 2, 10, 100, 1000]), + # Test small max_manifest_file_size in a smaller chance, as most of the + # time we wnat manifest history to be preserved to help debug + "max_manifest_file_size" : lambda : random.choice( + [t * 16384 if t < 3 else 1024 * 1024 * 1024 for t in range(1,30)]) } _TEST_DIR_ENV_VAR = 'TEST_TMPDIR'