From 4c85c6a4030d7d613230cd4b2204c42f941fd552 Mon Sep 17 00:00:00 2001 From: Ekaterina Dimitrova Date: Mon, 19 Sep 2022 10:28:54 -0400 Subject: [PATCH] key_cache_save_period, row_cache_save_period, counter_cache_save_period are not deprecated and we should not emit deprecation warning on startup for them Patch by Ekaterina Dimitrova; reviewed by Stefan Miklosovic for CASSANDRA-17904 --- CHANGES.txt | 1 + .../cassandra/pages/configuration/configuration.adoc | 3 ++- src/java/org/apache/cassandra/config/Config.java | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ed646ceb20..afaf5d8acf 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.1-alpha2 + * We should not emit deprecation warning on startup for `key_cache_save_period`, `row_cache_save_period`, `counter_cache_save_period` (CASSANDRA-17904) * upsert with adder support is not consistent with numbers and strings in LWT (CASSANDRA-17857) * Fix race and return after failing connections (CASSANDRA-17618) * Speculative execution threshold unit mismatch (CASSANDRA-17877) diff --git a/doc/modules/cassandra/pages/configuration/configuration.adoc b/doc/modules/cassandra/pages/configuration/configuration.adoc index 488dad8fd3..9b4df248b2 100644 --- a/doc/modules/cassandra/pages/configuration/configuration.adoc +++ b/doc/modules/cassandra/pages/configuration/configuration.adoc @@ -216,4 +216,5 @@ hinted_handoff_enabled: false https://issues.apache.org/jira/browse/CASSANDRA-17379[CASSANDRA-17379] was opened to improve the user experience and deprecate the overloading. By default, we refuse starting Cassandra with a config containing both old and new config keys for the same parameter. Start Cassandra with `-Dcassandra.allow_new_old_config_keys=true` to override. For historical reasons duplicate config keys -in `cassandra.yaml` are allowed by default, start Cassandra with `-Dcassandra.allow_duplicate_config_keys=false` to disallow this. \ No newline at end of file +in `cassandra.yaml` are allowed by default, start Cassandra with `-Dcassandra.allow_duplicate_config_keys=false` to disallow this. +Please note that `key_cache_save_period`, `row_cache_save_period`, `counter_cache_save_period` will be affected only by `-Dcassandra.allow_duplicate_config_keys`. \ No newline at end of file diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java index 7fd9b05816..df419e780c 100644 --- a/src/java/org/apache/cassandra/config/Config.java +++ b/src/java/org/apache/cassandra/config/Config.java @@ -434,19 +434,19 @@ public class Config public volatile int key_cache_keys_to_save = Integer.MAX_VALUE; @Replaces(oldName = "key_cache_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE_LONG, deprecated = true) public DataStorageSpec.LongMebibytesBound key_cache_size = null; - @Replaces(oldName = "key_cache_save_period", converter = Converters.SECONDS_CUSTOM_DURATION, deprecated = true) + @Replaces(oldName = "key_cache_save_period", converter = Converters.SECONDS_CUSTOM_DURATION) public volatile DurationSpec.IntSecondsBound key_cache_save_period = new DurationSpec.IntSecondsBound("4h"); public String row_cache_class_name = "org.apache.cassandra.cache.OHCProvider"; @Replaces(oldName = "row_cache_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE_LONG, deprecated = true) public DataStorageSpec.LongMebibytesBound row_cache_size = new DataStorageSpec.LongMebibytesBound("0MiB"); - @Replaces(oldName = "row_cache_save_period", converter = Converters.SECONDS_CUSTOM_DURATION, deprecated = true) + @Replaces(oldName = "row_cache_save_period", converter = Converters.SECONDS_CUSTOM_DURATION) public volatile DurationSpec.IntSecondsBound row_cache_save_period = new DurationSpec.IntSecondsBound("0s"); public volatile int row_cache_keys_to_save = Integer.MAX_VALUE; @Replaces(oldName = "counter_cache_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE_LONG, deprecated = true) public DataStorageSpec.LongMebibytesBound counter_cache_size = null; - @Replaces(oldName = "counter_cache_save_period", converter = Converters.SECONDS_CUSTOM_DURATION, deprecated = true) + @Replaces(oldName = "counter_cache_save_period", converter = Converters.SECONDS_CUSTOM_DURATION) public volatile DurationSpec.IntSecondsBound counter_cache_save_period = new DurationSpec.IntSecondsBound("7200s"); public volatile int counter_cache_keys_to_save = Integer.MAX_VALUE;