belliottsmith commented on code in PR #141:
URL: https://github.com/apache/cassandra-accord/pull/141#discussion_r1852055169
##########
accord-core/src/main/java/accord/messages/InformDurable.java:
##########
@@ -63,6 +67,22 @@ private InformDurable(TxnId txnId, Route<?> scope, long
waitForEpoch, @Nullable
this.durability = durability;
}
+ public static void informHome(Node node, Topologies any, TxnId txnId,
Route<?> route, Timestamp executeAt)
+ {
+ long homeEpoch = txnId.epoch();
+ Topology homeEpochTopology = any.forEpoch(homeEpoch);
+ int homeShardIndex = homeEpochTopology.indexForKey(route.homeKey());
+ if (homeShardIndex < 0)
+ {
+ homeEpochTopology = node.topology().globalForEpoch(homeEpoch);
+ homeShardIndex = homeEpochTopology.indexForKey(route.homeKey());
+ }
+
+ Shard homeShard = homeEpochTopology.get(homeShardIndex);
+ Topologies homeTopology = new Topologies.Single(any, new
Topology(homeEpoch, homeShard));
+ node.send(homeShard.nodes, to -> new InformDurable(to, homeTopology,
route.homeKeyOnlyRoute(), txnId, executeAt, Majority));
Review Comment:
I guess `durable` is a slightly overloaded concept. But, something is
_durable_ once it is known to a majority. Basically it means can survive our
tolerated number of failures. We have higher levels of durability, and
confusingly we also have `Local` durability (that perhaps we should remove,
since it isn't _durable_). Anyway, I'm happy to parameterise it, but `Majority`
is the base level at which you can call something _durable_, so if unspecified
should normally be assumed.
--
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]