bdeggleston commented on code in PR #4106:
URL: https://github.com/apache/cassandra/pull/4106#discussion_r2075862059
##########
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:
Cool thanks. I was thinking that instead of writing a system that explicitly
deputizes nodes to transmit offsets in lieu of down nodes, a simpler approach
would be for each node to broadcast their own offsets and also broadcast how
long it’s been since they’ve received offsets from other replicas. Once some
threshold is passed, another node (determined deterministically - not via
coordination) would begin including the information from the missing node in
its broadcasts to that node. That would limit both the amount of wasteful
message processing without adding a lot of additional scope or state
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]