iamaleksey commented on code in PR #4106: URL: https://github.com/apache/cassandra/pull/4106#discussion_r2068463236
########## 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: The mid/long term idea is that in presence of a failed node another one will temporarily take over its responsibility to broadcast offsets and perform background reconciliation for the mutations previously written. A third mode (replica, primary, and deputy). Doing that instead of broadcasting everything to reduce the overhead. Would implement this when we start the work on recovery. -- 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