bdeggleston commented on code in PR #4106: URL: https://github.com/apache/cassandra/pull/4106#discussion_r2060548513
########## src/java/org/apache/cassandra/replication/CoordinatorLogId.java: ########## @@ -142,5 +148,12 @@ public long serializedSize(CoordinatorLogId logId, int version) { return TypeSizes.sizeof(logId.hostId) + TypeSizes.sizeof(logId.hostLogId); } - }; + + public long serializedSize(long logId, int version) + { + return TypeSizes.sizeof(logId); + } + } + + static final Serializer serializer = new Serializer(); Review Comment: why did you switch from an anonymous implementation to a class definition + instantiation? ########## src/java/org/apache/cassandra/replication/Shard.java: ########## @@ -94,6 +109,42 @@ void addSummaryForRange(AbstractBounds<PartitionPosition> range, boolean include }); } + List<InetAddressAndPort> remoteReplicas() + { + List<InetAddressAndPort> replicas = new ArrayList<>(participants.size() - 1); + for (int i = 0, size = participants.size(); i < size; ++i) + { + int hostId = participants.get(i); + if (hostId != localHostId) + replicas.add(ClusterMetadata.current().directory.endpoint(new NodeId(hostId))); + } + return replicas; + } + + /** + * Collects replicated offsets for the logs owned by this coordinator on this shard. + */ + ShardReplicatedOffsets collectReplicatedOffsets() + { + Long2ObjectHashMap<LogReplicatedOffsets> offsets = new Long2ObjectHashMap<>(); + for (CoordinatorLogPrimary log : primaryLogs()) Review Comment: why not just transmit all logs? For truncation / failure recovery making replicas communicate about received mutations even with an unreachable coordinator would prevent unnecessary gaps in replicas reconciled sets and work around certain network partitions -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org