belliottsmith commented on code in PR #237:
URL: https://github.com/apache/cassandra-accord/pull/237#discussion_r2270087709


##########
accord-core/src/main/java/accord/impl/progresslog/DefaultProgressLog.java:
##########
@@ -219,60 +223,26 @@ public void update(SafeCommandStore safeStore, TxnId 
txnId, Command before, Comm
         if (!txnId.isVisible())
             return;
 
-        TxnState state = null;
         Route<?> beforeRoute = before.route();
         Route<?> afterRoute = after.route();
-        if (force || (afterRoute != null && beforeRoute == null) || 
(after.durability().isDurableOrInvalidated() && 
!before.durability().isDurableOrInvalidated()))
-            state = updateOrInitialiseHomeState(safeStore, after, get(txnId));
-
         SaveStatus beforeSaveStatus = before.saveStatus();
         SaveStatus afterSaveStatus = after.saveStatus();
-        if (beforeSaveStatus == afterSaveStatus && !force)
-            return;
-
-        if (state == null)
-            state = get(txnId);
-
-        if (state == null)
-            return;
 
-        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())
+        boolean updateWaiting = force || beforeSaveStatus != afterSaveStatus;
+        boolean updateHome = updateWaiting || (afterRoute != null && 
beforeRoute == null) || !before.durability().isAtLeast(after.durability());

Review Comment:
   I think we would need an `isAtMost` method if we wanted it that way around.



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