diff --git a/HISTORY.md b/HISTORY.md index 4adc0300b0..5f3f0713e1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,6 +13,8 @@ * Remove deprecated option DBOption::table_cache_remove_scan_count_limit. * Remove deprecated API AdvancedColumnFamilyOptions::soft_rate_limit. * Remove deprecated API AdvancedColumnFamilyOptions::hard_rate_limit. +* Remove deprecated API DBOption::base_background_compactions. +* Remove deprecated API DBOptions::purge_redundant_kvs_while_flush. ### Behavior Changes * Disallow the combination of DBOptions.use_direct_io_for_flush_and_compaction == true and DBOptions.writable_file_max_buffer_size == 0. This combination can cause WritableFileWriter::Append() to loop forever, and it does not make much sense in direct IO. diff --git a/db/c.cc b/db/c.cc index 964f65e7b0..50dd016b56 100644 --- a/db/c.cc +++ b/db/c.cc @@ -3225,15 +3225,6 @@ int rocksdb_options_get_max_background_compactions(rocksdb_options_t* opt) { return opt->rep.max_background_compactions; } -void rocksdb_options_set_base_background_compactions(rocksdb_options_t* opt, - int n) { - opt->rep.base_background_compactions = n; -} - -int rocksdb_options_get_base_background_compactions(rocksdb_options_t* opt) { - return opt->rep.base_background_compactions; -} - void rocksdb_options_set_max_background_flushes(rocksdb_options_t* opt, int n) { opt->rep.max_background_flushes = n; } diff --git a/db/c_test.c b/db/c_test.c index 4b150bb130..fe5b2e24df 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -490,7 +490,6 @@ int main(int argc, char** argv) { rocksdb_options_set_write_buffer_size(options, 100000); rocksdb_options_set_paranoid_checks(options, 1); rocksdb_options_set_max_open_files(options, 10); - rocksdb_options_set_base_background_compactions(options, 1); table_options = rocksdb_block_based_options_create(); rocksdb_block_based_options_set_block_cache(table_options, cache); @@ -1613,9 +1612,6 @@ int main(int argc, char** argv) { rocksdb_options_set_max_background_compactions(o, 3); CheckCondition(3 == rocksdb_options_get_max_background_compactions(o)); - rocksdb_options_set_base_background_compactions(o, 4); - CheckCondition(4 == rocksdb_options_get_base_background_compactions(o)); - rocksdb_options_set_max_background_flushes(o, 5); CheckCondition(5 == rocksdb_options_get_max_background_flushes(o)); @@ -1845,7 +1841,6 @@ int main(int argc, char** argv) { CheckCondition(123456 == rocksdb_options_get_max_subcompactions(copy)); CheckCondition(2 == rocksdb_options_get_max_background_jobs(copy)); CheckCondition(3 == rocksdb_options_get_max_background_compactions(copy)); - CheckCondition(4 == rocksdb_options_get_base_background_compactions(copy)); CheckCondition(5 == rocksdb_options_get_max_background_flushes(copy)); CheckCondition(6 == rocksdb_options_get_max_log_file_size(copy)); CheckCondition(7 == rocksdb_options_get_log_file_time_to_roll(copy)); @@ -2051,10 +2046,6 @@ int main(int argc, char** argv) { CheckCondition(13 == rocksdb_options_get_max_background_compactions(copy)); CheckCondition(3 == rocksdb_options_get_max_background_compactions(o)); - rocksdb_options_set_base_background_compactions(copy, 14); - CheckCondition(14 == rocksdb_options_get_base_background_compactions(copy)); - CheckCondition(4 == rocksdb_options_get_base_background_compactions(o)); - rocksdb_options_set_max_background_flushes(copy, 15); CheckCondition(15 == rocksdb_options_get_max_background_flushes(copy)); CheckCondition(5 == rocksdb_options_get_max_background_flushes(o)); diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 2112d26def..68690c15a8 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1170,10 +1170,6 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_background_compactions( rocksdb_options_t*, int); extern ROCKSDB_LIBRARY_API int rocksdb_options_get_max_background_compactions( rocksdb_options_t*); -extern ROCKSDB_LIBRARY_API void rocksdb_options_set_base_background_compactions( - rocksdb_options_t*, int); -extern ROCKSDB_LIBRARY_API int rocksdb_options_get_base_background_compactions( - rocksdb_options_t*); extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_background_flushes( rocksdb_options_t*, int); extern ROCKSDB_LIBRARY_API int rocksdb_options_get_max_background_flushes( diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index 06c45eab3a..b848d32da7 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -657,12 +657,6 @@ struct DBOptions { // Dynamically changeable through SetDBOptions() API. int max_background_jobs = 2; - // NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the - // value of max_background_jobs. This option is ignored. - // - // Dynamically changeable through SetDBOptions() API. - int base_background_compactions = -1; - // DEPRECATED: RocksDB automatically decides this based on the // value of max_background_jobs. For backwards compatibility we will set // `max_background_jobs = max_background_compactions + max_background_flushes` diff --git a/java/rocksjni/options.cc b/java/rocksjni/options.cc index 03b631fe0d..af33a88d74 100644 --- a/java/rocksjni/options.cc +++ b/java/rocksjni/options.cc @@ -665,28 +665,6 @@ void Java_org_rocksdb_Options_setDeleteObsoleteFilesPeriodMicros( ->delete_obsolete_files_period_micros = static_cast(micros); } -/* - * Class: org_rocksdb_Options - * Method: setBaseBackgroundCompactions - * Signature: (JI)V - */ -void Java_org_rocksdb_Options_setBaseBackgroundCompactions( - JNIEnv*, jobject, jlong jhandle, jint max) { - reinterpret_cast(jhandle) - ->base_background_compactions = static_cast(max); -} - -/* - * Class: org_rocksdb_Options - * Method: baseBackgroundCompactions - * Signature: (J)I - */ -jint Java_org_rocksdb_Options_baseBackgroundCompactions( - JNIEnv*, jobject, jlong jhandle) { - return reinterpret_cast(jhandle) - ->base_background_compactions; -} - /* * Class: org_rocksdb_Options * Method: maxBackgroundCompactions @@ -6188,28 +6166,6 @@ jlong Java_org_rocksdb_DBOptions_deleteObsoleteFilesPeriodMicros( ->delete_obsolete_files_period_micros; } -/* - * Class: org_rocksdb_DBOptions - * Method: setBaseBackgroundCompactions - * Signature: (JI)V - */ -void Java_org_rocksdb_DBOptions_setBaseBackgroundCompactions( - JNIEnv*, jobject, jlong jhandle, jint max) { - reinterpret_cast(jhandle) - ->base_background_compactions = static_cast(max); -} - -/* - * Class: org_rocksdb_DBOptions - * Method: baseBackgroundCompactions - * Signature: (J)I - */ -jint Java_org_rocksdb_DBOptions_baseBackgroundCompactions( - JNIEnv*, jobject, jlong jhandle) { - return reinterpret_cast(jhandle) - ->base_background_compactions; -} - /* * Class: org_rocksdb_DBOptions * Method: setMaxBackgroundCompactions diff --git a/java/src/main/java/org/rocksdb/DBOptions.java b/java/src/main/java/org/rocksdb/DBOptions.java index 2930a92728..ff2119488b 100644 --- a/java/src/main/java/org/rocksdb/DBOptions.java +++ b/java/src/main/java/org/rocksdb/DBOptions.java @@ -403,20 +403,6 @@ public int maxBackgroundJobs() { return maxBackgroundJobs(nativeHandle_); } - @Override - @Deprecated - public void setBaseBackgroundCompactions( - final int baseBackgroundCompactions) { - assert(isOwningHandle()); - setBaseBackgroundCompactions(nativeHandle_, baseBackgroundCompactions); - } - - @Override - public int baseBackgroundCompactions() { - assert(isOwningHandle()); - return baseBackgroundCompactions(nativeHandle_); - } - @Override @Deprecated public DBOptions setMaxBackgroundCompactions( @@ -1342,9 +1328,6 @@ private native void dbPaths(final long handle, final String[] paths, private native void setDeleteObsoleteFilesPeriodMicros( long handle, long micros); private native long deleteObsoleteFilesPeriodMicros(long handle); - private native void setBaseBackgroundCompactions(long handle, - int baseBackgroundCompactions); - private native int baseBackgroundCompactions(long handle); private native void setMaxBackgroundCompactions( long handle, int maxBackgroundCompactions); private native int maxBackgroundCompactions(long handle); diff --git a/java/src/main/java/org/rocksdb/MutableDBOptions.java b/java/src/main/java/org/rocksdb/MutableDBOptions.java index 2fe2426af9..bfba1dab3c 100644 --- a/java/src/main/java/org/rocksdb/MutableDBOptions.java +++ b/java/src/main/java/org/rocksdb/MutableDBOptions.java @@ -64,7 +64,6 @@ private interface MutableDBOptionKey extends MutableOptionKey {} public enum DBOption implements MutableDBOptionKey { max_background_jobs(ValueType.INT), - base_background_compactions(ValueType.INT), max_background_compactions(ValueType.INT), avoid_flush_during_shutdown(ValueType.BOOLEAN), writable_file_max_buffer_size(ValueType.LONG), @@ -133,19 +132,6 @@ public int maxBackgroundJobs() { return getInt(DBOption.max_background_jobs); } - @Override - @Deprecated - public void setBaseBackgroundCompactions( - final int baseBackgroundCompactions) { - setInt(DBOption.base_background_compactions, - baseBackgroundCompactions); - } - - @Override - public int baseBackgroundCompactions() { - return getInt(DBOption.base_background_compactions); - } - @Override @Deprecated public MutableDBOptionsBuilder setMaxBackgroundCompactions( diff --git a/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java b/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java index 385eecad10..cbd1c14baf 100644 --- a/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java +++ b/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java @@ -21,34 +21,6 @@ public interface MutableDBOptionsInterface {"allow_os_buffer", {0, OptionType::kBoolean, OptionVerificationType::kDeprecated, OptionTypeFlags::kMutable}}, + {"base_background_compactions", + {0, OptionType::kInt, OptionVerificationType::kDeprecated, + OptionTypeFlags::kMutable}}, {"max_background_jobs", {offsetof(struct MutableDBOptions, max_background_jobs), OptionType::kInt, OptionVerificationType::kNormal, @@ -66,10 +69,6 @@ static std::unordered_map {offsetof(struct MutableDBOptions, max_background_compactions), OptionType::kInt, OptionVerificationType::kNormal, OptionTypeFlags::kMutable}}, - {"base_background_compactions", - {offsetof(struct MutableDBOptions, base_background_compactions), - OptionType::kInt, OptionVerificationType::kNormal, - OptionTypeFlags::kMutable}}, {"max_subcompactions", {offsetof(struct MutableDBOptions, max_subcompactions), OptionType::kUInt32T, OptionVerificationType::kNormal, @@ -962,7 +961,6 @@ const std::string& ImmutableDBOptions::GetWalDir( MutableDBOptions::MutableDBOptions() : max_background_jobs(2), - base_background_compactions(-1), max_background_compactions(-1), max_subcompactions(0), avoid_flush_during_shutdown(false), @@ -982,7 +980,6 @@ MutableDBOptions::MutableDBOptions() MutableDBOptions::MutableDBOptions(const DBOptions& options) : max_background_jobs(options.max_background_jobs), - base_background_compactions(options.base_background_compactions), max_background_compactions(options.max_background_compactions), max_subcompactions(options.max_subcompactions), avoid_flush_during_shutdown(options.avoid_flush_during_shutdown), diff --git a/options/db_options.h b/options/db_options.h index 49188abbad..4d582d240f 100644 --- a/options/db_options.h +++ b/options/db_options.h @@ -122,7 +122,6 @@ struct MutableDBOptions { void Dump(Logger* log) const; int max_background_jobs; - int base_background_compactions; int max_background_compactions; uint32_t max_subcompactions; bool avoid_flush_during_shutdown; diff --git a/options/options_helper.cc b/options/options_helper.cc index aa421b8b81..c7678f06c7 100644 --- a/options/options_helper.cc +++ b/options/options_helper.cc @@ -87,8 +87,6 @@ DBOptions BuildDBOptions(const ImmutableDBOptions& immutable_db_options, options.delete_obsolete_files_period_micros = mutable_db_options.delete_obsolete_files_period_micros; options.max_background_jobs = mutable_db_options.max_background_jobs; - options.base_background_compactions = - mutable_db_options.base_background_compactions; options.max_background_compactions = mutable_db_options.max_background_compactions; options.bytes_per_sync = mutable_db_options.bytes_per_sync; diff --git a/options/options_settable_test.cc b/options/options_settable_test.cc index 366e148a8f..5bc1f8173c 100644 --- a/options/options_settable_test.cc +++ b/options/options_settable_test.cc @@ -274,7 +274,6 @@ TEST_F(OptionsSettableTest, DBOptionsAllFieldsSettable) { "max_open_files=72;" "max_file_opening_threads=35;" "max_background_jobs=8;" - "base_background_compactions=3;" "max_background_compactions=33;" "use_fsync=true;" "use_adaptive_mutex=false;" diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index e8d90af0c6..0f55263184 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -493,8 +493,6 @@ DEFINE_int32(max_background_compactions, "The maximum number of concurrent background compactions" " that can occur in parallel."); -DEFINE_int32(base_background_compactions, -1, "DEPRECATED"); - DEFINE_uint64(subcompactions, 1, "Maximum number of subcompactions to divide L0-L1 compactions " "into.");