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


##########
accord-core/src/main/java/accord/impl/InMemoryCommandStore.java:
##########
@@ -291,18 +333,49 @@ private void forEach(Routable keyOrRange, Ranges slice, 
Consumer<RoutableKey> fo
         }
     }
 
+    @Override
+    protected void registerHistoricalTransactions(Deps deps)
+    {
+        Ranges allRanges = rangesForEpochHolder.get().all();
+        deps.keyDeps.keys().forEach(allRanges, key -> {
+            SafeCommandsForKey cfk = commandsForKey(key).createSafeReference();
+            deps.keyDeps.forEach(key, txnId -> {
+                // TODO (desired, efficiency): this can be made more efficient 
by batching by epoch
+                if 
(rangesForEpochHolder.get().coordinates(txnId).contains(key))
+                    return; // already coordinates, no need to replicate
+                if 
(!rangesForEpochHolder.get().allBefore(txnId.epoch()).contains(key))
+                    return;
+
+                cfk.registerNotWitnessed(txnId);

Review Comment:
   This is for preaccept dependencies. If we are *currently* a replica then if 
we don’t know about a transaction it doesn’t affect any quorum, as either it 
had reached a quorum without us and that’s fine, or it hadn’t and that’s also 
fine. This is just the transaction log history we need to replicate to 
ourselves so transactions no longer need to contact older epochs.



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