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 #270: 14759
Date Tue, 18 Sep 2018 15:34:28 GMT
Github user aweisberg commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/270#discussion_r218483495
  
    --- 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 --
    
    Why do you have to construct a new replica? You can't add conflict?
    
    Can conflict have a different range?


---

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


Mime
View raw message