dcapwell commented on code in PR #50:
URL: https://github.com/apache/cassandra-accord/pull/50#discussion_r1284880114
##########
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:
> If we're going to impose this for callers, we should do it consistently
in this case the logic within the `map` failed as the executeAt epoch wasn't
known yet (found in `BurnTest`), so don't think we can actually pass this
responsibility to the `callers` as they didn't give us the `executeAt`, we
learned it.
> I'm not too keen on awaitEpoch accepting Nullable and no-oping though
it was this or implement the no-oping at the call site
```
if (executeAt != null && !node.hasEpoch(executeAt.epoch())
return node.topology().awaitEpoch(executeAt.epoch()).map(this:realWork)
return this.realWork(null);
```
> , feels too error prone.
Why is that? all the `withEpoch` logic does this... we only wait
if-and-only-if we don't know the epoch yet.
--
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]