dcapwell commented on code in PR #50:
URL: https://github.com/apache/cassandra-accord/pull/50#discussion_r1275477518


##########
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:
   ```suggestion
                                   Invariants.checkState(test.has(success), 
"Command %s was expected to have known %s, but had %s", command, success, 
command.known());
   ```
   
   this condition broke for me, had the following
   
   ```
   Command Command@1725054538{[2,48526,3,15]:AcceptedWithDefinition} was 
expected to have known [Definition,ExecuteAt,Outcome], but had [Definition]
   ```



-- 
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]

Reply via email to