cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aweisberg <...@git.apache.org>
Subject [GitHub] cassandra pull request #265: 14705
Date Tue, 11 Sep 2018 22:09:24 GMT
Github user aweisberg commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/265#discussion_r216839700
  
    --- Diff: src/java/org/apache/cassandra/service/reads/AbstractReadExecutor.java ---
    @@ -184,30 +185,28 @@ public static AbstractReadExecutor getReadExecutor(SinglePartitionReadCommand
co
             ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(command.metadata().id);
             SpeculativeRetryPolicy retry = cfs.metadata().params.speculativeRetry;
     
    -        // Endpoints for Token
    -        ReplicaLayout.ForToken replicaLayout = ReplicaLayout.forRead(keyspace, command.partitionKey().getToken(),
consistencyLevel, retry);
    +        ReplicaPlan.ForTokenRead replicaPlan = ReplicaPlans.forRead(keyspace, command.partitionKey().getToken(),
consistencyLevel, retry);
     
             // Speculative retry is disabled *OR*
             // 11980: Disable speculative retry if using EACH_QUORUM in order to prevent
miscounting DC responses
             if (retry.equals(NeverSpeculativeRetryPolicy.INSTANCE) || consistencyLevel ==
ConsistencyLevel.EACH_QUORUM)
    -            // TODO Looks like we might want to move speculation into the replica layout,
but that might be a story for post-4.0
    -            return new NeverSpeculatingReadExecutor(cfs, command, replicaLayout, queryStartNanoTime,
false);
    +            return new NeverSpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime,
false);
     
             // There are simply no extra replicas to speculate.
             // Handle this separately so it can record failed attempts to speculate due to
lack of replicas
    -        if (replicaLayout.selected().size() == replicaLayout.all().size())
    +        if (replicaPlan.contact().size() == replicaPlan.candidates().size())
             {
                 boolean recordFailedSpeculation = consistencyLevel != ConsistencyLevel.ALL;
    -            return new NeverSpeculatingReadExecutor(cfs, command, replicaLayout, queryStartNanoTime,
recordFailedSpeculation);
    +            return new NeverSpeculatingReadExecutor(cfs, command, replicaPlan, queryStartNanoTime,
recordFailedSpeculation);
             }
     
             // If CL.ALL, upgrade to AlwaysSpeculating;
    --- End diff --
    
    This doesn't seem to have anything to do with CL.ALL anymore. And I don't get why CL.ALL
benefits from always speculating since it fails if it doesn't get the data response anyways?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message