diff --git a/db_stress_tool/db_stress_common.h b/db_stress_tool/db_stress_common.h index c5996cf5e9..64b39b741f 100644 --- a/db_stress_tool/db_stress_common.h +++ b/db_stress_tool/db_stress_common.h @@ -298,6 +298,8 @@ DECLARE_bool(verify_sst_unique_id_in_manifest); DECLARE_int32(create_timestamped_snapshot_one_in); +DECLARE_bool(allow_data_in_errors); + constexpr long KB = 1024; constexpr int kRandomValueMaxFactor = 3; constexpr int kValueMaxLen = 100; diff --git a/db_stress_tool/db_stress_gflags.cc b/db_stress_tool/db_stress_gflags.cc index b2f78a4c98..c2594beb6a 100644 --- a/db_stress_tool/db_stress_gflags.cc +++ b/db_stress_tool/db_stress_gflags.cc @@ -976,4 +976,8 @@ DEFINE_int32( create_timestamped_snapshot_one_in, 0, "On non-zero, create timestamped snapshots upon transaction commits."); +DEFINE_bool(allow_data_in_errors, + ROCKSDB_NAMESPACE::Options().allow_data_in_errors, + "If true, allow logging data, e.g. key, value in LOG files."); + #endif // GFLAGS diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index b8c97fd236..b9ac4734b0 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -2931,6 +2931,8 @@ void InitializeOptionsFromFlags( if (FLAGS_user_timestamp_size > 0) { CheckAndSetOptionsForUserTimestamp(options); } + + options.allow_data_in_errors = FLAGS_allow_data_in_errors; } void InitializeOptionsGeneral( diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 18a35f4f36..a163d86677 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -1646,6 +1646,10 @@ static const bool FLAGS_readwritepercent_dummy __attribute__((__unused__)) = DEFINE_int32(disable_seek_compaction, false, "Not used, left here for backwards compatibility"); +DEFINE_bool(allow_data_in_errors, + ROCKSDB_NAMESPACE::Options().allow_data_in_errors, + "If true, allow logging data, e.g. key, value in LOG files."); + static const bool FLAGS_deletepercent_dummy __attribute__((__unused__)) = RegisterFlagValidator(&FLAGS_deletepercent, &ValidateInt32Percent); static const bool FLAGS_table_cache_numshardbits_dummy __attribute__((__unused__)) = @@ -4450,6 +4454,8 @@ class Benchmark { options.comparator = test::BytewiseComparatorWithU64TsWrapper(); } + options.allow_data_in_errors = FLAGS_allow_data_in_errors; + // Integrated BlobDB options.enable_blob_files = FLAGS_enable_blob_files; options.min_blob_size = FLAGS_min_blob_size; @@ -4477,7 +4483,6 @@ class Benchmark { exit(1); } #endif // ROCKSDB_LITE - } void InitializeOptionsGeneral(Options* opts) { diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 73c018f382..e0b4d36c28 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -178,6 +178,7 @@ default_params = { "wal_compression": lambda: random.choice(["none", "zstd"]), "verify_sst_unique_id_in_manifest": 1, # always do unique_id verification "secondary_cache_uri": "", + "allow_data_in_errors": True, } _TEST_DIR_ENV_VAR = 'TEST_TMPDIR'