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


##########
accord-core/src/main/java/accord/local/SaveStatus.java:
##########
@@ -126,21 +219,68 @@ public static SaveStatus enrich(SaveStatus status, Known 
known)
             case Accepted:
             case AcceptedInvalidate:
             case PreCommitted:
-
                 if (known.isSatisfiedBy(status.known))
                     return status;
                 return get(status.status, status.known.merge(known));
+
+            case Truncated:
+                switch (status)
+                {
+                    default: throw new AssertionError();
+                    case Erased:
+                        if (!known.outcome.isOrWasApply() || known.executeAt 
!= ExecuteAtKnown)
+                            return Erased;
+
+                    case TruncatedApply:
+                        if (known.outcome != Outcome.Apply)
+                            return TruncatedApply;
+
+                    case TruncatedApplyWithOutcome:
+                        if (known.deps != DepsKnown)
+                            return TruncatedApplyWithOutcome;
+
+                    case TruncatedApplyWithDeps:
+                        if (!known.isDefinitionKnown())
+                            return TruncatedApplyWithDeps;
+
+                        return Applied;
+                }
         }
 
         return status;
     }
 
-    public static SaveStatus merge(SaveStatus a, Ballot acceptedA, SaveStatus 
b, Ballot acceptedB)
+    public static SaveStatus merge(SaveStatus a, Ballot acceptedA, SaveStatus 
b, Ballot acceptedB, boolean preferKnowledge)

Review Comment:
   Hmm, actually this is a more general problem as we look at Phase first which 
means we'll ignore all greater knowledge.



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