iamaleksey commented on code in PR #4106:
URL: https://github.com/apache/cassandra/pull/4106#discussion_r2075683807


##########
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:
   Fair enough. I've pushed something that's mid-way there. Replicas now 
broadcast offsets for every log, not just the ones they are primary for - but 
only their own offsets. This avoids the redundancy while keeping the messages 
themselves as fresh as they could be: node's knowledge of its own received 
mutation should be even slightly ahead of that of the coordinators'.



-- 
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

Reply via email to