diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 73a46b424..697cd265d 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -41,6 +41,7 @@ default_params = { "enable_pipelined_write": 0, "expected_values_path": expected_values_file.name, "flush_one_in": 1000000, + "index_type": lambda: random.randint(0, 2), "max_background_compactions": 20, "max_bytes_for_level_base": 10485760, "max_key": 100000000, @@ -48,6 +49,7 @@ default_params = { "mmap_read": lambda: random.randint(0, 1), "nooverwritepercent": 1, "open_files": lambda : random.choice([-1, 500000]), + "partition_filters": lambda: random.randint(0, 1), "prefixpercent": 5, "progress_reports": 0, "readpercent": 45, @@ -174,6 +176,9 @@ def finalize_and_sanitize(src_params): # Disable compaction TTL in FIFO compaction, because right # now assertion failures are triggered. dest_params["compaction_ttl"] = 0 + if dest_params["partition_filters"] == 1: + dest_params["index_type"] = 2 + dest_params["use_block_based_filter"] = 0 return dest_params diff --git a/tools/db_stress.cc b/tools/db_stress.cc index 8403eced1..bf1af305f 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -353,6 +353,14 @@ DEFINE_int32(bloom_bits, 10, "Bloom filter bits per key. " DEFINE_bool(use_block_based_filter, false, "use block based filter" "instead of full filter for block based table"); +DEFINE_bool(partition_filters, false, "use partitioned filters " + "for block-based table"); + +DEFINE_int32( + index_type, + static_cast(rocksdb::BlockBasedTableOptions::kBinarySearch), + "Type of block-based table index (see `enum IndexType` in table.h)"); + DEFINE_string(db, "", "Use the db with the following name."); DEFINE_string(secondaries_base, "", @@ -2777,6 +2785,9 @@ class StressTest { block_based_options.index_block_restart_interval = static_cast(FLAGS_index_block_restart_interval); block_based_options.filter_policy = filter_policy_; + block_based_options.partition_filters = FLAGS_partition_filters; + block_based_options.index_type = + static_cast(FLAGS_index_type); options_.table_factory.reset( NewBlockBasedTableFactory(block_based_options)); options_.db_write_buffer_size = FLAGS_db_write_buffer_size;