You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2018/04/18 10:39:02 UTC
[3/9] cassandra git commit: Deprecate background repair and
probablistic read_repair_chance table options
Deprecate background repair and probablistic read_repair_chance table options
patch by Aleksey Yeschenko; reviewed by Blake Eggleston for
CASSANDRA-13910
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/eaf9bf18
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/eaf9bf18
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/eaf9bf18
Branch: refs/heads/trunk
Commit: eaf9bf18b2ec50713170a9ca472c34586b17a5a3
Parents: 00e5a3d
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Mon Apr 16 20:56:18 2018 +0100
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Wed Apr 18 11:26:13 2018 +0100
----------------------------------------------------------------------
CHANGES.txt | 2 ++
NEWS.txt | 6 ++++
.../cql3/statements/TableAttributes.java | 36 ++++++++++++++++++--
3 files changed, 42 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/eaf9bf18/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1aa291f..847f347 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
3.0.17
+ * Deprecate background repair and probablistic read_repair_chance table options
+ (CASSANDRA-13910)
* Fix unbounded validation compactions on repair / revert CASSANDRA-13797 (CASSANDRA-14332)
* Avoid deadlock when running nodetool refresh before node is fully up (CASSANDRA-14310)
* Handle all exceptions when opening sstables (CASSANDRA-14202)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/eaf9bf18/NEWS.txt
----------------------------------------------------------------------
diff --git a/NEWS.txt b/NEWS.txt
index c06030e..234154e 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -53,6 +53,12 @@ Upgrading
- Changes to bloom_filter_fp_chance will no longer take effect on existing sstables when the node is restarted. Only
compactions/upgradesstables regenerates bloom filters and Summaries sstable components. See CASSANDRA-11163
+Deprecation
+-----------
+ - Background read repair has been deprecated. dclocal_read_repair_chance and
+ read_repair_chance table options have been deprecated, and will be removed entirely in 4.0.
+ See CASSANDRA-13910 for details.
+
3.0.16
=====
http://git-wip-us.apache.org/repos/asf/cassandra/blob/eaf9bf18/src/java/org/apache/cassandra/cql3/statements/TableAttributes.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/TableAttributes.java b/src/java/org/apache/cassandra/cql3/statements/TableAttributes.java
index c1a9d54..595fdb3 100644
--- a/src/java/org/apache/cassandra/cql3/statements/TableAttributes.java
+++ b/src/java/org/apache/cassandra/cql3/statements/TableAttributes.java
@@ -27,6 +27,7 @@ import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.exceptions.SyntaxException;
import org.apache.cassandra.schema.*;
import org.apache.cassandra.schema.TableParams.Option;
+import org.apache.cassandra.service.ClientWarn;
import static java.lang.String.format;
@@ -36,6 +37,8 @@ public final class TableAttributes extends PropertyDefinitions
private static final Set<String> validKeywords;
private static final Set<String> obsoleteKeywords;
+ private static boolean loggedReadRepairChanceDeprecationWarnings;
+
static
{
ImmutableSet.Builder<String> validBuilder = ImmutableSet.builder();
@@ -105,7 +108,17 @@ public final class TableAttributes extends PropertyDefinitions
}
if (hasOption(Option.DCLOCAL_READ_REPAIR_CHANCE))
- builder.dcLocalReadRepairChance(getDouble(Option.DCLOCAL_READ_REPAIR_CHANCE));
+ {
+ double chance = getDouble(Option.DCLOCAL_READ_REPAIR_CHANCE);
+
+ if (chance != 0.0)
+ {
+ ClientWarn.instance.warn("dclocal_read_repair_chance table option has been deprecated and will be removed in version 4.0");
+ maybeLogReadRepairChanceDeprecationWarning();
+ }
+
+ builder.dcLocalReadRepairChance(chance);
+ }
if (hasOption(Option.DEFAULT_TIME_TO_LIVE))
builder.defaultTimeToLive(getInt(Option.DEFAULT_TIME_TO_LIVE));
@@ -123,7 +136,17 @@ public final class TableAttributes extends PropertyDefinitions
builder.minIndexInterval(getInt(Option.MIN_INDEX_INTERVAL));
if (hasOption(Option.READ_REPAIR_CHANCE))
- builder.readRepairChance(getDouble(Option.READ_REPAIR_CHANCE));
+ {
+ double chance = getDouble(Option.READ_REPAIR_CHANCE);
+
+ if (chance != 0.0)
+ {
+ ClientWarn.instance.warn("read_repair_chance table option has been deprecated and will be removed in version 4.0");
+ maybeLogReadRepairChanceDeprecationWarning();
+ }
+
+ builder.readRepairChance(chance);
+ }
if (hasOption(Option.SPECULATIVE_RETRY))
builder.speculativeRetry(SpeculativeRetryParam.fromString(getString(Option.SPECULATIVE_RETRY)));
@@ -134,6 +157,15 @@ public final class TableAttributes extends PropertyDefinitions
return builder.build();
}
+ private void maybeLogReadRepairChanceDeprecationWarning()
+ {
+ if (!loggedReadRepairChanceDeprecationWarnings)
+ {
+ logger.warn("dclocal_read_repair_chance and read_repair_chance table options have been deprecated and will be removed in version 4.0");
+ loggedReadRepairChanceDeprecationWarnings = true;
+ }
+ }
+
private Double getDeprecatedCrcCheckChance(Map<String, String> compressionOpts)
{
String value = compressionOpts.get(Option.CRC_CHECK_CHANCE.toString().toLowerCase());
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org