From a0ebec3804451e1aebda56b51dec82d6d900c5b1 Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Tue, 18 Sep 2018 15:41:27 -0700 Subject: [PATCH] Extend crash test with index_block_restart_interval (#4383) Summary: The default for index_block_restart_interval is 1 but some use 16 in production. The patch extends crash test to test both values. Pull Request resolved: https://github.com/facebook/rocksdb/pull/4383 Differential Revision: D9887304 Pulled By: maysamyabandeh fbshipit-source-id: a8d00fea974a79ad563f9f4d9d7b069e9f746a8f --- HISTORY.md | 1 + tools/db_crashtest.py | 1 + tools/db_stress.cc | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 5b3856632..a4d28e0c1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -10,6 +10,7 @@ ### Bug Fixes * Avoid creating empty SSTs and subsequently deleting them in certain cases during compaction. * Sync CURRENT file contents during checkpoint. +* Fix format_version 4 bug with partitioned filters ## 5.16.0 (8/21/2018) ### Public API Change diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 7384d3d85..c71c8c99d 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -56,6 +56,7 @@ default_params = { "write_buffer_size": 4 * 1024 * 1024, "writepercent": 35, "format_version": lambda: random.randint(2, 4), + "index_block_restart_interval": lambda: random.choice(1, 16), } _TEST_DIR_ENV_VAR = 'TEST_TMPDIR' diff --git a/tools/db_stress.cc b/tools/db_stress.cc index f012771b8..45a7c9a0d 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -232,6 +232,11 @@ DEFINE_int32( static_cast(rocksdb::BlockBasedTableOptions().format_version), "Format version of SST files."); +DEFINE_int32(index_block_restart_interval, + rocksdb::BlockBasedTableOptions().index_block_restart_interval, + "Number of keys between restart points " + "for delta encoding of keys in index block."); + DEFINE_int32(max_background_compactions, rocksdb::Options().max_background_compactions, "The maximum number of concurrent background compactions " @@ -2296,6 +2301,8 @@ class StressTest { block_based_options.block_size = FLAGS_block_size; block_based_options.format_version = static_cast(FLAGS_format_version); + block_based_options.index_block_restart_interval = + static_cast(FLAGS_index_block_restart_interval); block_based_options.filter_policy = filter_policy_; options_.table_factory.reset( NewBlockBasedTableFactory(block_based_options));