Skip to content

Commit

Permalink
CASSANDRA-14801 Mark as pending only missing part of the token range
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrrr committed Mar 26, 2020
1 parent a33b032 commit bb36cd0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/java/org/apache/cassandra/locator/TokenMetadata.java
Expand Up @@ -895,11 +895,13 @@ private static PendingRangeMaps calculatePendingRanges(AbstractReplicationStrate
{
EndpointsForRange currentReplicas = strategy.calculateNaturalReplicas(range.right, metadata);
EndpointsForRange newReplicas = strategy.calculateNaturalReplicas(range.right, allLeftMetadata);
for (Replica replica : newReplicas)
for (Replica newReplica : newReplicas)
{
if (currentReplicas.endpoints().contains(replica.endpoint()))
if (currentReplicas.endpoints().contains(newReplica.endpoint()))
continue;
newPendingRanges.addPendingRange(range, replica);

for (Replica pendingReplica : newReplica.subtractSameReplication(addressRanges.get(newReplica.endpoint())))
newPendingRanges.addPendingRange(range, pendingReplica);
}
}

Expand Down

0 comments on commit bb36cd0

Please sign in to comment.