mirror of https://github.com/apache/cassandra
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:
parent
0bb133e39d
commit
6105da3f58
|
|
@ -1,4 +1,5 @@
|
||||||
3.0.9
|
3.0.9
|
||||||
|
* Disable RR and speculative retry with EACH_QUORUM reads (CASSANDRA-11980)
|
||||||
* Add option to override compaction space check (CASSANDRA-12180)
|
* Add option to override compaction space check (CASSANDRA-12180)
|
||||||
* Faster startup by only scanning each directory for temporary files once (CASSANDRA-12114)
|
* 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
|
* Respond with v1/v2 protocol header when responding to driver that attempts
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,10 @@ public abstract class AbstractReadExecutor
|
||||||
{
|
{
|
||||||
Keyspace keyspace = Keyspace.open(command.metadata().ksName);
|
Keyspace keyspace = Keyspace.open(command.metadata().ksName);
|
||||||
List<InetAddress> allReplicas = StorageProxy.getLiveSortedEndpoints(keyspace, command.partitionKey());
|
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);
|
List<InetAddress> targetReplicas = consistencyLevel.filterForQuery(keyspace, allReplicas, repairDecision);
|
||||||
|
|
||||||
// Throw UAE early if we don't have enough replicas.
|
// Throw UAE early if we don't have enough replicas.
|
||||||
|
|
@ -168,7 +171,10 @@ public abstract class AbstractReadExecutor
|
||||||
SpeculativeRetryParam retry = cfs.metadata.params.speculativeRetry;
|
SpeculativeRetryParam retry = cfs.metadata.params.speculativeRetry;
|
||||||
|
|
||||||
// Speculative retry is disabled *OR* there are simply no extra replicas to speculate.
|
// 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);
|
return new NeverSpeculatingReadExecutor(keyspace, command, consistencyLevel, targetReplicas);
|
||||||
|
|
||||||
if (targetReplicas.size() == allReplicas.size())
|
if (targetReplicas.size() == allReplicas.size())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue