cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From belliottsmith <...@git.apache.org>
Subject [GitHub] cassandra pull request #265: 14705
Date Wed, 12 Sep 2018 06:43:47 GMT
Github user belliottsmith commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/265#discussion_r216912914
  
    --- 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 --
    
    No idea.  I don't understand either, but as you say, it looks like the comment is anyway
stale.  I'll remove it.


---

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


Mime
View raw message