aweisberg commented on code in PR #4043:
URL: https://github.com/apache/cassandra/pull/4043#discussion_r2027770849


##########
src/java/org/apache/cassandra/service/paxos/v1/PrepareCallback.java:
##########
@@ -79,8 +86,28 @@ public synchronized void onResponse(Message<PrepareResponse> 
message)
         latch.decrement();
     }
 
-    public Iterable<InetAddressAndPort> replicasMissingMostRecentCommit()
+    public Iterable<InetAddressAndPort> 
replicasMissingMostRecentCommit(TableMetadata metadata)
     {
+        /**
+         * this check is only needed for mixed mode operation with 4.0 and can 
be removed once upgrade support dropped
+         * see the comment in {@link 
org.apache.cassandra.distributed.upgrade.MixedModePaxosTTLTest} for a full 
explanation.
+         */
+        if (DatabaseDescriptor.paxosStatePurging() == 
Config.PaxosStatePurging.legacy)
+        {
+            // In general, we need every replicas that have answered to the 
prepare (a quorum) to agree on the MRC (see
+            // coment in StorageProxy.beginAndRepairPaxos(), but basically we 
need to make sure at least a quorum of nodes
+            // have learn a commit before commit a new one otherwise that 
previous commit is not guaranteed to have reach a
+            // quorum and further commit may proceed on incomplete 
information).
+            // However, if that commit is too hold, it may have been expired 
from some of the replicas paxos table (we don't
+            // keep the paxos state forever or that could grow unchecked), and 
we could end up in some infinite loop as
+            // explained on CASSANDRA-12043. To avoid that, we ignore a MRC 
that is too old, i.e. older than the TTL we set
+            // on paxos tables. For such old commit, we rely on hints and 
repair to ensure the commit has indeed be

Review Comment:
   ```suggestion
               // on paxos tables. For such an old commit, we rely on hints and 
repair to ensure the commit has indeed been
   ```



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to