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 #224: 14405 replicas
Date Wed, 16 May 2018 17:06:10 GMT
Github user aweisberg commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/224#discussion_r188695095
  
    --- Diff: src/java/org/apache/cassandra/service/reads/AbstractReadExecutor.java ---
    @@ -269,24 +272,26 @@ public void executeAsync()
             {
                 // if CL + RR result in covering all replicas, getReadExecutor forces AlwaysSpeculating.
 So we know
                 // that the last replica in our list is "extra."
    -            List<InetAddressAndPort> initialReplicas = targetReplicas.subList(0,
targetReplicas.size() - 1);
    +            ReplicaList initialReplicas = targetReplicas.subList(0, targetReplicas.size()
- 1);
    +
    +            Replicas.checkFull(initialReplicas);
     
                 if (handler.blockfor < initialReplicas.size())
                 {
                     // We're hitting additional targets for read repair.  Since our "extra"
replica is the least-
                     // preferred by the snitch, we do an extra data read to start with against
a replica more
                     // likely to reply; better to let RR fail than the entire query.
    -                makeDataRequests(initialReplicas.subList(0, 2));
    +                makeDataRequests(initialReplicas.subList(0, 2).asEndpoints());
                     if (initialReplicas.size() > 2)
    -                    makeDigestRequests(initialReplicas.subList(2, initialReplicas.size()));
    +                    makeDigestRequests(initialReplicas.subList(2, initialReplicas.size()).asEndpoints());
                 }
                 else
                 {
                     // not doing read repair; all replies are important, so it doesn't matter
which nodes we
                     // perform data reads against vs digest.
    -                makeDataRequests(initialReplicas.subList(0, 1));
    +                makeDataRequests(initialReplicas.subList(0, 1).asEndpoints());
                     if (initialReplicas.size() > 1)
    -                    makeDigestRequests(initialReplicas.subList(1, initialReplicas.size()));
    +                    makeDigestRequests(initialReplicas.subList(1, initialReplicas.size()).asEndpoints());
    --- End diff --
    
    Avoid intermediate sublist


---

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


Mime
View raw message