From 3054fd620c1b33269366a81797235dc8cbe8272d Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Thu, 18 Jan 2024 13:24:46 -0800 Subject: [PATCH] Mark unsafe/outdated options as deprecated These options were added for users to roll back a behavior change without downgrading. To our knowledge they were not needed so can now be removed. - `level_compaction_dynamic_file_size` - `ignore_max_compaction_bytes_for_input` These options were added for users to disable an online validation in case it is expensive or has false positives. Those validations have shown to be cheap, correct, and are enabled by default, so these options can be removed. - `check_flush_compaction_key_order` - `flush_verify_memtable_count` - `compaction_verify_record_count` - `fail_if_options_file_error` This option was added for users to violate API contracts or run old databases that used to violate API contracts. It appears to be set by MyRocks so it is unclear whether we can remove it. In any case we should discourage it until it can be removed. - `enforce_single_del_contracts` --- include/rocksdb/advanced_options.h | 6 ++++++ include/rocksdb/options.h | 8 ++++++++ .../deprecate_unsafe_or_outdated_options.md | 1 + 3 files changed, 15 insertions(+) create mode 100644 unreleased_history/public_api_changes/deprecate_unsafe_or_outdated_options.md diff --git a/include/rocksdb/advanced_options.h b/include/rocksdb/advanced_options.h index 76301f888984..465bf38bceee 100644 --- a/include/rocksdb/advanced_options.h +++ b/include/rocksdb/advanced_options.h @@ -547,6 +547,8 @@ struct AdvancedColumnFamilyOptions { // Default: true bool level_compaction_dynamic_level_bytes = true; + // DEPRECATED: This function might be removed in a future release. + // // Allows RocksDB to generate files that are not exactly the target_file_size // only for the non-bottommost files. Which can reduce the write-amplification // from compaction. The file size could be from 0 to 2x target_file_size. @@ -582,6 +584,8 @@ struct AdvancedColumnFamilyOptions { // Dynamically changeable through SetOptions() API uint64_t max_compaction_bytes = 0; + // DEPRECATED: This function might be removed in a future release. + // // When setting up compaction input files, we ignore the // `max_compaction_bytes` limit when pulling in input files that are entirely // within output key range. @@ -697,6 +701,8 @@ struct AdvancedColumnFamilyOptions { // Default: false bool optimize_filters_for_hits = false; + // DEPRECATED: This function might be removed in a future release. + // // During flush or compaction, check whether keys inserted to output files // are in order. // diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index 9146f6d7bc4c..22bce40f40e7 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -502,6 +502,8 @@ struct DBOptions { // Default: true bool paranoid_checks = true; + // DEPRECATED: This function might be removed in a future release. + // // If true, during memtable flush, RocksDB will validate total entries // read in flush, and compare with counter inserted into it. // @@ -512,6 +514,8 @@ struct DBOptions { // Default: true bool flush_verify_memtable_count = true; + // DEPRECATED: This function might be removed in a future release. + // // If true, during compaction, RocksDB will count the number of entries // read and compare it against the number of entries in the compaction // input files. This is intended to add protection against corruption @@ -1206,6 +1210,8 @@ struct DBOptions { // currently. WalFilter* wal_filter = nullptr; + // DEPRECATED: This function might be removed in a future release. + // // If true, then DB::Open, CreateColumnFamily, DropColumnFamily, and // SetOptions will fail if options file is not properly persisted. // @@ -1421,6 +1427,8 @@ struct DBOptions { // Default: kNonVolatileBlockTier CacheTier lowest_used_cache_tier = CacheTier::kNonVolatileBlockTier; + // DEPRECATED: This function might be removed in a future release. + // // If set to false, when compaction or flush sees a SingleDelete followed by // a Delete for the same user key, compaction job will not fail. // Otherwise, compaction job will fail. diff --git a/unreleased_history/public_api_changes/deprecate_unsafe_or_outdated_options.md b/unreleased_history/public_api_changes/deprecate_unsafe_or_outdated_options.md new file mode 100644 index 000000000000..93e359462df7 --- /dev/null +++ b/unreleased_history/public_api_changes/deprecate_unsafe_or_outdated_options.md @@ -0,0 +1 @@ +Deprecated several options: `level_compaction_dynamic_file_size`, `ignore_max_compaction_bytes_for_input`, `check_flush_compaction_key_order`, `flush_verify_memtable_count`, `compaction_verify_record_count`, `fail_if_options_file_error`, and `enforce_single_del_contracts`