diff --git a/db_stress_tool/db_stress_common.h b/db_stress_tool/db_stress_common.h index a3be90fdf..b4ac518b7 100644 --- a/db_stress_tool/db_stress_common.h +++ b/db_stress_tool/db_stress_common.h @@ -215,6 +215,7 @@ DECLARE_bool(use_full_merge_v1); DECLARE_int32(sync_wal_one_in); DECLARE_bool(avoid_unnecessary_blocking_io); DECLARE_bool(write_dbid_to_manifest); +DECLARE_bool(avoid_flush_during_recovery); DECLARE_uint64(max_write_batch_group_size_bytes); DECLARE_bool(level_compaction_dynamic_level_bytes); DECLARE_int32(verify_checksum_one_in); diff --git a/db_stress_tool/db_stress_gflags.cc b/db_stress_tool/db_stress_gflags.cc index ece78cf33..a4d502261 100644 --- a/db_stress_tool/db_stress_gflags.cc +++ b/db_stress_tool/db_stress_gflags.cc @@ -646,6 +646,10 @@ DEFINE_bool(write_dbid_to_manifest, ROCKSDB_NAMESPACE::Options().write_dbid_to_manifest, "Write DB_ID to manifest"); +DEFINE_bool(avoid_flush_during_recovery, + ROCKSDB_NAMESPACE::Options().avoid_flush_during_recovery, + "Avoid flush during recovery"); + DEFINE_uint64(max_write_batch_group_size_bytes, ROCKSDB_NAMESPACE::Options().max_write_batch_group_size_bytes, "Max write batch group size"); diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 6e5013faa..bc0daed60 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -1826,6 +1826,7 @@ void StressTest::Open() { options_.avoid_unnecessary_blocking_io = FLAGS_avoid_unnecessary_blocking_io; options_.write_dbid_to_manifest = FLAGS_write_dbid_to_manifest; + options_.avoid_flush_during_recovery = FLAGS_avoid_flush_during_recovery; options_.max_write_batch_group_size_bytes = FLAGS_max_write_batch_group_size_bytes; options_.level_compaction_dynamic_level_bytes = diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index ced21162f..14395d40f 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -106,6 +106,8 @@ default_params = { [0, 0, 0, 1024 * 1024, 8 * 1024 * 1024, 128 * 1024 * 1024]), "avoid_unnecessary_blocking_io" : random.randint(0, 1), "write_dbid_to_manifest" : random.randint(0, 1), + "avoid_flush_during_recovery" : random.choice( + [1 if t == 0 else 0 for t in range(0, 8)]), "max_write_batch_group_size_bytes" : lambda: random.choice( [16, 64, 1024 * 1024, 16 * 1024 * 1024]), "level_compaction_dynamic_level_bytes" : True,