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


##########
accord-core/src/main/java/accord/local/Commands.java:
##########
@@ -1097,38 +1100,40 @@ public static Command setDurability(SafeCommandStore 
safeStore, SafeCommand safe
         if (command.is(Truncated))
             return command;
 
-        if (command.durability().compareTo(durability) >= 0)
+        Durability oldDurability = command.durability();
+        Durability newDurability = oldDurability.mergeMax(durability);
+        if (newDurability == oldDurability)
             return command;
 
         Command updated = supplementParticipants(safeStore, safeCommand, 
participants);
         participants = updated.participants();
         if (executeAt != null && command.status().hasBeen(Committed) && 
!command.executeAt().equals(executeAt))
             safeStore.agent().onInconsistentTimestamp(command, 
command.asCommitted().executeAt(), executeAt);
 
-        if (command.durability().compareTo(durability) < 0)
+        updated = safeCommand.update(safeStore, 
updated.updateDurability(newDurability));
+        TxnId txnId = command.txnId();
+        DependencyElision updates = OFF;
+        if (newDurability.isDurable() && !oldDurability.isDurable()) updates = 
IF_DURABLY_PREAPPLIED;
+        else if (newDurability.isDurablyCommitted() && 
!durability.isDurablyCommitted()) updates = IF_DURABLY_COMMITTED;

Review Comment:
   good catch



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