cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject [1/6] cassandra git commit: Disable RR and speculative retry with EACH_QUORUM reads
Date Tue, 26 Jul 2016 14:00:48 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 0bb133e39 -> 6105da3f5
  refs/heads/cassandra-3.9 79fbdbe6c -> 67909ea84
  refs/heads/trunk d8ca69c01 -> accf7a472


Disable RR and speculative retry with EACH_QUORUM reads

Patch by Carl Yeksigian; reviewed by Aleksey Yeschenko for CASSANDRA-11980


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/6105da3f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6105da3f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6105da3f

Branch: refs/heads/cassandra-3.0
Commit: 6105da3f5875bee3d8d7ca9db21348ad20cdeaba
Parents: 0bb133e
Author: Carl Yeksigian <carl@apache.org>
Authored: Tue Jul 26 09:58:06 2016 -0400
Committer: Carl Yeksigian <carl@apache.org>
Committed: Tue Jul 26 09:58:06 2016 -0400

----------------------------------------------------------------------
 CHANGES.txt                                               |  1 +
 .../apache/cassandra/service/AbstractReadExecutor.java    | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6105da3f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 342382e..3c485dd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.9
+ * Disable RR and speculative retry with EACH_QUORUM reads (CASSANDRA-11980)
  * Add option to override compaction space check (CASSANDRA-12180)
  * Faster startup by only scanning each directory for temporary files once (CASSANDRA-12114)
  * Respond with v1/v2 protocol header when responding to driver that attempts

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6105da3f/src/java/org/apache/cassandra/service/AbstractReadExecutor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/AbstractReadExecutor.java b/src/java/org/apache/cassandra/service/AbstractReadExecutor.java
index 05fa437..cae1f1a 100644
--- a/src/java/org/apache/cassandra/service/AbstractReadExecutor.java
+++ b/src/java/org/apache/cassandra/service/AbstractReadExecutor.java
@@ -152,7 +152,10 @@ public abstract class AbstractReadExecutor
     {
         Keyspace keyspace = Keyspace.open(command.metadata().ksName);
         List<InetAddress> allReplicas = StorageProxy.getLiveSortedEndpoints(keyspace,
command.partitionKey());
-        ReadRepairDecision repairDecision = command.metadata().newReadRepairDecision();
+        // 11980: Excluding EACH_QUORUM reads from potential RR, so that we do not miscount
DC responses
+        ReadRepairDecision repairDecision = consistencyLevel == ConsistencyLevel.EACH_QUORUM
+                                            ? ReadRepairDecision.NONE
+                                            : command.metadata().newReadRepairDecision();
         List<InetAddress> targetReplicas = consistencyLevel.filterForQuery(keyspace,
allReplicas, repairDecision);
 
         // Throw UAE early if we don't have enough replicas.
@@ -168,7 +171,10 @@ public abstract class AbstractReadExecutor
         SpeculativeRetryParam retry = cfs.metadata.params.speculativeRetry;
 
         // Speculative retry is disabled *OR* there are simply no extra replicas to speculate.
-        if (retry.equals(SpeculativeRetryParam.NONE) || consistencyLevel.blockFor(keyspace)
== allReplicas.size())
+        // 11980: Disable speculative retry if using EACH_QUORUM in order to prevent miscounting
DC responses
+        if (retry.equals(SpeculativeRetryParam.NONE)
+            || consistencyLevel == ConsistencyLevel.EACH_QUORUM
+            || consistencyLevel.blockFor(keyspace) == allReplicas.size())
             return new NeverSpeculatingReadExecutor(keyspace, command, consistencyLevel,
targetReplicas);
 
         if (targetReplicas.size() == allReplicas.size())


Mime
View raw message