dcapwell commented on code in PR #50:
URL: https://github.com/apache/cassandra-accord/pull/50#discussion_r1275481838
##########
accord-core/src/main/java/accord/impl/SimpleProgressLog.java:
##########
@@ -483,59 +331,73 @@ void record(Known known)
}
@Override
- void run(Command command)
+ void run(SafeCommandStore safeStore, SafeCommand safeCommand)
{
- if (command.has(blockedUntil))
+ Command command = safeCommand.current();
+ if (command.isAtLeast(blockedUntil))
{
setProgress(NoneExpected);
return;
}
setProgress(Investigating);
// first make sure we have enough information to obtain
the command locally
- Timestamp executeAt = command.hasBeen(PreCommitted) ?
command.executeAt() : null;
- long srcEpoch = (executeAt != null ? executeAt :
txnId).epoch();
- // TODO (desired, consider): compute fromEpoch, the epoch
we already have this txn replicated until
- long toEpoch = Math.max(srcEpoch, node.topology().epoch());
- Unseekables<?, ?> someKeys = unseekables(command);
+ Timestamp executeAt = command.executeAtIfKnown();
+ Participants<?> maxParticipants = maxParticipants(command);
+ // we want to fetch a route if we have it, so that we can
go to our neighbouring shards for info
+ // (rather than the home shard, which may have GC'd its
state if the result is durable)
+ Unseekables<?> fetchKeys = maxContact(command);
BiConsumer<Known, Throwable> callback = (success, fail) ->
{
- commandStore.execute(PreLoadContext.empty(), ignore ->
{
+ // TODO (expected): this should be invoked on this
commandStore; also do not need to load txn unless in DEBUG mode
+ commandStore.execute(contextFor(txnId), safeStore0 -> {
if (progress() != Investigating)
return;
setProgress(Expected);
- if (fail == null)
+ if (fail == null &&
blockedUntil.isSatisfiedBy(success))
{
- if (!success.isDefinitionKnown())
invalidate(node, txnId, someKeys);
- else record(success);
+ Command test =
safeStore0.ifInitialised(txnId).current();
+ Invariants.checkState(test.has(success));
Review Comment:
`fetchKeys={homeKey:4#10347,[(2#11569,2#19367], (4#10346,4#10347],
(8#43265,8#45498]]}` so went down
`accord.coordinate.FetchData#fetch(accord.local.Status.Known,
accord.local.Node, accord.primitives.TxnId, accord.primitives.Route<?>,
accord.primitives.Timestamp,
java.util.function.BiConsumer<accord.local.Status.Known,java.lang.Throwable>)`
fetch call.
so, this looks like `QUORUM` has
```
success = {Status$Known@4051} "[Definition,ExecuteAt,Outcome]"
definition = {Status$Definition@4081} "DefinitionKnown"
executeAt = {Status$KnownExecuteAt@4082} "ExecuteAtKnown"
deps = {Status$KnownDeps@4083} "DepsUnknown"
outcome = {Status$Outcome@4084} "Apply"
```
but this single shard has yet to make progress.
--
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]