dcapwell commented on code in PR #65:
URL: https://github.com/apache/cassandra-accord/pull/65#discussion_r1443512142
##########
accord-core/src/main/java/accord/messages/Commit.java:
##########
@@ -275,6 +275,22 @@ public static void commitInvalidate(Node node, TxnId
txnId, Unseekables<?> infor
// TODO (expected, safety): this kind of check needs to be
inserted in all equivalent methods
Invariants.checkState(untilEpoch >= txnId.epoch());
Invariants.checkState(node.topology().hasEpoch(untilEpoch));
+ // Possible that the invalidation is due to the range no longer
existing in untilEpoch, which means that
Review Comment:
> How can this happen? We should only invoke with an untilEpoch we attempted
to Accept with, and we shouldn't attempt to Accept in an epoch where the keys
don't exist
This is the stack trace that hits it
```
commitInvalidate:287, Commit$Invalidate (accord.messages)
commitInvalidate:270, Commit$Invalidate (accord.messages)
lambda$commitInvalidate$12:365, Recover (accord.coordinate)
run:-1, 1373949107 (accord.coordinate.Recover$$Lambda$689)
withEpoch:297, Node (accord.local)
commitInvalidate:365, Recover (accord.coordinate)
lambda$invalidate$10:358, Recover (accord.coordinate)
accept:-1, 73688220 (accord.coordinate.Recover$$Lambda$686)
onSuccess:202, Propose$Invalidate (accord.coordinate)
onSuccess:137, Propose$Invalidate (accord.coordinate)
accept:-1, 353023213 (accord.messages.SafeCallback$$Lambda$555)
lambda$safeCall$1:74, SafeCallback (accord.messages)
```
this epoch is coming from `accord.coordinate.Recover#commitInvalidate`
```
Timestamp invalidateUntil = recoverOks.stream().map(ok ->
ok.executeAt).reduce(txnId, Timestamp::max);
```
the peers that are sending the `executeAt` have the following for `Command`
```
Command@1850137076{[1,5,2(KW),7]:AcceptedInvalidateWithDefinition}
```
This looks to be triggered by `accord.messages.Accept.Invalidate#apply`
> I think it is fine to contact untilEpoch even if some keys are missing?
I believe my original logic that Blake approved allowed this, but since you
asked for TM to reject these cases, we had to handle here.
--
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]