belliottsmith commented on code in PR #50:
URL: https://github.com/apache/cassandra-accord/pull/50#discussion_r1284882948
##########
accord-core/src/main/java/accord/coordinate/FetchData.java:
##########
@@ -147,13 +147,15 @@ private static Object fetchWithIncompleteRoute(Known
fetch, Node node, TxnId txn
});
}
- public static Object fetch(Known fetch, Node node, TxnId txnId,
FullRoute<?> route, @Nullable Timestamp executeAt, BiConsumer<Known, Throwable>
callback)
+ public static Object fetch(Known fetch, Node node, TxnId txnId,
FullRoute<?> route, @Nullable Timestamp executeAt, BiConsumer<? super Known,
Throwable> callback)
{
- Ranges ranges = node.topology().localRangesForEpochs(txnId.epoch(),
fetch.fetchEpoch(txnId, executeAt));
- return fetchInternal(ranges, fetch, node, txnId,
route.sliceStrict(ranges), executeAt, callback);
+ return node.awaitEpoch(executeAt).map(ignore -> {
Review Comment:
> so don't think we can actually pass this responsibility to the callers as
they didn't give us the executeAt, we learned it.
There's still an internal caller. I assume that would be L146 in
`fetchWithIncompleteRoute`?
Again, don't mind moving it into the callee, but we should do it
consistently.
> Why is that? all the withEpoch logic does this... we only wait
if-and-only-if we don't know the epoch yet.
Null could easily be a bug, rather than a legitimate lack of epoch to fetch
though. No other call-site provides no epoch; it may only provide an epoch we
already know.
--
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]