Disable RR and speculative retry with EACH_QUORUM reads

Patch by Carl Yeksigian; reviewed by Aleksey Yeschenko for CASSANDRA-11980
This commit is contained in:
Carl Yeksigian 2016-07-26 09:58:06 -04:00
parent 0bb133e39d
commit 6105da3f58
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -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())