Github user belliottsmith commented on a diff in the pull request:
https://github.com/apache/cassandra/pull/267#discussion_r219131794
--- Diff: src/java/org/apache/cassandra/service/StorageProxy.java ---
@@ -1021,18 +1021,18 @@ private static void
syncWriteToBatchlog(Collection<Mutation> mutations, Collecti
handler.get();
}
- private static void
asyncRemoveFromBatchlog(Collection<InetAddressAndPort> endpoints, UUID uuid)
+ private static void asyncRemoveFromBatchlog(ReplicaPlan.ForTokenWrite
replicaPlan, UUID uuid)
{
MessageOut<UUID> message = new
MessageOut<>(MessagingService.Verb.BATCH_REMOVE, uuid,
UUIDSerializer.serializer);
- for (InetAddressAndPort target : endpoints)
+ for (Replica target : replicaPlan.contacts())
{
if (logger.isTraceEnabled())
logger.trace("Sending batchlog remove request {} to {}",
uuid, target);
- if (target.equals(FBUtilities.getBroadcastAddressAndPort()))
- performLocally(Stage.MUTATION,
SystemReplicas.getSystemReplica(target), () -> BatchlogManager.remove(uuid));
+ if (target.isLocal())
--- End diff --
I thought we had ended up calling this `isSelf` because `isLocal` is
overloaded in this code (meaning, variably, is this instance (has our broadcast
address); is the same DC as this instance; has the 'local' address). Not
strictly related to this patch, but perhaps we should rename to `isSelf` while
we're here and remember? This is consistent with the nomenclature amongst the
TR patch, and in ReplicaCollection (`withoutSelf` and `selfIfPresent`)
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]