Github user belliottsmith commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/270#discussion_r218488201
  
    --- Diff: src/java/org/apache/cassandra/locator/ReplicaLayout.java ---
    @@ -275,7 +275,24 @@ public ForTokenWrite(EndpointsForToken natural, 
EndpointsForToken pending, Endpo
          */
         private static <E extends Endpoints<E>> E 
resolveWriteConflictsInNatural(E natural, E pending)
         {
    -        return natural.filter(r -> !r.isTransient() || 
!pending.contains(r.endpoint(), true));
    +        ReplicaCollection.Mutable<E> resolved = 
natural.newMutable(natural.size());
    +        for (Replica replica : natural)
    +        {
    +            // always prefer the full natural replica, if there is a 
conflict
    +            if (!replica.isFull())
    +            {
    +                Replica conflict = 
pending.byEndpoint().get(replica.endpoint());
    +                if (conflict != null)
    +                {
    +                    // If we have any pending transient->full movement, we 
need to move the full replica to our 'natural' bucket
    +                    // to avoid corrupting our count
    +                    if (conflict.isFull()) resolved.add(new 
Replica(replica.endpoint(), replica.range(), true));
    --- End diff --
    
    No, you're right, good catch.  Even if they are a different range, either 
should be acceptable for this query (by definition).  I'll push an update.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to