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


##########
accord-core/src/main/java/accord/local/RedundantBefore.java:
##########
@@ -712,37 +857,95 @@ public Ranges removePreBootstrap(TxnId txnId, Ranges 
ranges)
     {
         if (maxBootstrap.compareTo(txnId) <= 0)
             return ranges;
-        return foldl(ranges, Entry::removePreBootstrap, ranges, txnId, null, r 
-> false);
+        return foldl(ranges, Entry::withoutPreBootstrap, ranges, txnId, null, 
r -> false);
     }
 
     /**
-     * Subtract any ranges we consider stale or pre-bootstrap
+     * Subtract anything we don't need to coordinate (because they are known 
to be shard durable),
+     * and we don't execute locally, i.e. are pre-bootstrap or stale (or for 
RX are on ranges that are already retired)
      */
-    public Ranges expectToExecute(TxnId txnId, @Nonnull Timestamp executeAt, 
Ranges ranges)
+    public Participants<?> expectToOwn(TxnId txnId, @Nullable EpochSupplier 
executeAt, Participants<?> participants)
     {
-        Invariants.checkArgument(executeAt != null, "executeAt must not be 
null");
-        if (maxBootstrap.compareTo(txnId) <= 0 && (staleRanges == null || 
!staleRanges.intersects(ranges)))
-            return ranges;
-        return foldl(ranges, Entry::expectToExecute, ranges, txnId, executeAt, 
r -> false);
+        if (txnId.is(ExclusiveSyncPoint))
+        {
+            if (!mayFilterStaleOrPreBootstrapOrRetired(txnId, participants))
+                return participants;
+
+            return foldl(participants, 
Entry::withoutRedundantAnd_StaleOrPreBootstrapOrRetired, participants, txnId, i 
-> false);
+        }
+        else
+        {
+            if (!mayFilterStaleOrPreBootstrap(txnId, participants))
+                return participants;
+
+            return foldl(participants, 
Entry::withoutRedundantAnd_StaleOrPreBootstrap, participants, txnId, executeAt, 
r -> false);
+        }
     }
 
     /**
-     * Subtract any ranges we consider stale or pre-bootstrap at any point
+     * Subtract anything we won't execute locally, i.e. are pre-bootstrap or 
stale (or for RX are on ranges that are already retired)
      */
-    public Ranges everExpectToExecute(TxnId txnId, Ranges ranges)
+    public Participants<?> expectToExecute(TxnId txnId, @Nullable 
EpochSupplier executeAt, Participants<?> participants)
     {
-        if (maxBootstrap.compareTo(txnId) <= 0 && (staleRanges == null || 
!staleRanges.intersects(ranges)))
-            return ranges;
-        return foldl(ranges, Entry::expectToExecute, ranges, txnId, null, r -> 
false);
+        if (txnId.is(ExclusiveSyncPoint))
+        {
+            if (!mayFilterStaleOrPreBootstrapOrRetired(txnId, participants))
+                return participants;
+
+            return foldl(participants, 
Entry::withoutStaleOrPreBootstrapOrLocallyRetired, participants, txnId, i -> 
false);
+        }
+        else
+        {
+            if (!mayFilterStaleOrPreBootstrap(txnId, participants))

Review Comment:
   right, the first branch is explicitly if `is(ExclusiveSyncPoint)`



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