dcapwell commented on code in PR #38:
URL: https://github.com/apache/cassandra-accord/pull/38#discussion_r1162113855
##########
accord-core/src/main/java/accord/local/Node.java:
##########
@@ -203,7 +203,7 @@ public void withEpoch(long epoch, Runnable runnable)
else
{
configService.fetchTopologyForEpoch(epoch);
- topology.awaitEpoch(epoch).addCallback(runnable);
+ topology.awaitEpoch(epoch).addCallback(runnable).begin(agent());
Review Comment:
this wasn't a bug before, its due to a change in this patch.
`AsyncResult` is just like a `Future`, so `begin` noops... `AsyncChain`
needs a `begin` to start the chain (we delay execution of the chain until the
whole chain is known; `begin` marks the completion of the chain).
When you `awaitEpoch` you need to know if the caller is in a `CommandStore`
or not, and if in a `CommandStore` you need to start a new chain where all
logic will run in the `CommandStore` and not w/e thread populated the
`epoch`... This means there are 2 different returns: `AsyncResult` (future that
will eventually have the epoch) and `AsyncChain` (`result.map(a -> a,
CommandStore.current())`)
--
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]