ifesdjeen commented on code in PR #231:
URL: https://github.com/apache/cassandra-accord/pull/231#discussion_r2231791500


##########
accord-core/src/main/java/accord/coordinate/Recover.java:
##########
@@ -399,6 +399,7 @@ private void recover()
                                            .intersecting(route, id -> 
!recoverOks.containsKey(id.node));
         InferredFastPath fastPath;
         if (txnId.hasPrivilegedCoordinator() && coordinatorInRecoveryQuorum) 
fastPath = Reject;
+        else if (txnId.is(Txn.Kind.ExclusiveSyncPoint)) fastPath = Reject;

Review Comment:
   nit: can be 
   ```
           if ((txnId.hasPrivilegedCoordinator() && 
coordinatorInRecoveryQuorum) ||
               txnId.is(Txn.Kind.ExclusiveSyncPoint)) fastPath = Reject;
   ```



##########
accord-core/src/main/java/accord/impl/progresslog/DefaultProgressLog.java:
##########
@@ -211,23 +212,39 @@ public void update(SafeCommandStore safeStore, TxnId 
txnId, Command before, Comm
 
         state.waiting().record(this, afterSaveStatus);
         if (state.isHomeInitialised())
+            updateHomeState(safeStore, state, before, after);
+    }
+
+    @Override
+    public void decided(SafeCommandStore safeStore, TxnId txnId)
+    {
+        TxnState state = get(txnId);
+        if (state != null && state.isHomeInitialised())
+            state.home().atLeast(safeStore, this, Decided, NoneExpected);
+    }
+
+    private void updateHomeState(SafeCommandStore safeStore, TxnState state, 
Command before, Command after)
+    {
+        switch (after.saveStatus())
         {
-            switch (afterSaveStatus)
-            {
-                case Stable:
-                    state.home().atLeast(safeStore, this, Undecided, 
NoneExpected);
-                    break;
-                case ReadyToExecute:
-                    state.home().atLeast(safeStore, this, AwaitReadyToExecute, 
Queued);
-                    break;
-                case PreApplied:
-                    state.home().atLeast(safeStore, this, ReadyToExecute, 
Queued);
-                    break;
-            }
+            case Stable:
+                if (!after.acceptedOrCommitted().equals(Ballot.ZERO) || 
(before != null && before.saveStatus() == SaveStatus.Committed))
+                    state.home().atLeast(safeStore, this, Decided, 
NoneExpected);
+            default:

Review Comment:
   should this be a fall-through? probably worth adding a comment



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to