You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "pmcfadin (via GitHub)" <gi...@apache.org> on 2026/10/21 21:26:37 UTC

[PR] CASSANDRA-21537 (6.0): Serialise local metadata proposals so concurrent DDL keeps its retry budget [cassandra]

pmcfadin opened a new pull request, #5290:
URL: https://github.com/apache/cassandra/pull/5290

   The `cassandra-6.0` version of #4970. Details, reproduction and measurements are in [CASSANDRA-21537](https://issues.apache.org/jira/browse/CASSANDRA-21537), and the description and review discussion are on #4970.
   
   The patch is the same commits as #4970, cherry-picked onto `cassandra-6.0` with no conflicts. The only difference is where the CHANGES.txt entry goes: under `6.0-alpha3` here, and under `Merged from 6.0:` on trunk.
   
   Tested locally on JDK 21: `AbstractLocalProcessorLockTest` and `AbstractLocalProcessorCycleTest` (9 tests) and `ConcurrentSchemaCommitTest` pass. A pre-commit CI run is in progress, and its results will be attached to the ticket.
   
   patch by Patrick McFadin, Jon Haddad; reviewed by TBD for CASSANDRA-21537
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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-unsubscribe@cassandra.apache.org

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


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


Re: [PR] CASSANDRA-21537 (6.0): Serialise local metadata proposals so concurrent DDL keeps its retry budget [cassandra]

Posted by "michaelsembwever (via GitHub)" <gi...@apache.org>.
michaelsembwever commented on PR #5290:
URL: https://github.com/apache/cassandra/pull/5290#issuecomment-6403282615

   suggested changes: https://github.com/pmcfadin/cassandra/pull/1 


-- 
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-unsubscribe@cassandra.apache.org

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


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


Re: [PR] CASSANDRA-21537 (6.0): Serialise local metadata proposals so concurrent DDL keeps its retry budget [cassandra]

Posted by "michaelsembwever (via GitHub)" <gi...@apache.org>.
michaelsembwever commented on code in PR #5290:
URL: https://github.com/apache/cassandra/pull/5290#discussion_r4375839903


##########
src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java:
##########
@@ -59,51 +63,91 @@ public final Commit.Result commit(Entry.Id entryId, Transformation transform, fi
         String transformStr = transform.toString(); // convert once as idempotent and used in multiple logs
         logger.debug("Starting local commit of {} with policy {}", transformStr, retryPolicy);
         long commitStart = nanoTime();
+        boolean proposalAttempted = false;
         while (!retryPolicy.hasExpired() && !log.isClosed())
         {
-            ClusterMetadata previous = log.waitForHighestConsecutive();
-            if (!acceptCommit(previous))
-            {
-                String msg = String.format("Node %s is not a CMS member in epoch %s; members=%s",
-                                           FBUtilities.getBroadcastAddressAndPort(),
-                                           previous.epoch.getEpoch(),
-                                           previous.fullCMSMembers());
-                logger.warn(msg);
-                throw new NotCMSException(msg);
-            }
+            if (!acquireProposalLock(retryPolicy))
+                return notAdmitted(retryPolicy, proposalAttempted);
 
+            ClusterMetadata previous;
             Transformation.Result result;
-            if (!transform.eligibleToCommit(previous))
-            {
-                result = new Transformation.Rejected(INVALID, "Transformation rejected, can't commit " + transformStr +
-                                                              " it not supported with cluster common serialization version " + previous.directory.commonSerializationVersion +
-                                                              " and min/max serialization versions " + previous.directory.clusterMinVersion + "/" + previous.directory.clusterMaxVersion);
-            }
-            else
-            {
-                result = executeStrictly(previous, transform);
-            }
-            Version previousVersion = previous.directory.commonSerializationVersion;
-            if (result.isSuccess())
+            boolean applied = false;
+            Throwable failure = null;
+            try
             {
-                Version newVersion = result.success().metadata.directory.commonSerializationVersion;
-                if (previousVersion.isEqualOrBefore(Version.V9) &&
-                         newVersion.isAtLeast(Version.V10) &&
-                         !result.success().metadata.inProgressSequences.isEmpty())
+                if (log.isClosed() || retryPolicy.hasExpired())
+                    break;
+
+                previous = log.waitForHighestConsecutive();
+                if (!acceptCommit(previous))
                 {
-                    result = new Transformation.Rejected(INVALID, String.format("Committing %s would bump the serialization version from %s to %s," +
-                                                                                " which is not allowed when having ongoing multi step operations (%s) - see CASSANDRA-XYZ",
-                                                                                transform, previousVersion, newVersion, result.success().metadata.inProgressSequences));
+                    String msg = String.format("Node %s is not a CMS member in epoch %s; members=%s",
+                                               FBUtilities.getBroadcastAddressAndPort(),
+                                               previous.epoch.getEpoch(),
+                                               previous.fullCMSMembers());
+                    logger.warn(msg);
+                    throw new NotCMSException(msg);
+                }
+
+                if (!transform.eligibleToCommit(previous))
+                {
+                    result = new Transformation.Rejected(INVALID, "Transformation rejected, can't commit " + transformStr +
+                                                                  ". It is not supported with cluster common serialization version " + previous.directory.commonSerializationVersion +
+                                                                  " and min/max serialization versions " + previous.directory.clusterMinVersion + "/" + previous.directory.clusterMaxVersion);
+                }
+                else
+                {
+                    result = executeStrictly(previous, transform);
+                }
+                Version previousVersion = previous.directory.commonSerializationVersion;
+                if (result.isSuccess())
+                {
+                    Version newVersion = result.success().metadata.directory.commonSerializationVersion;
+                    if (previousVersion.isEqualOrBefore(Version.V9) &&
+                             newVersion.isAtLeast(Version.V10) &&
+                             !result.success().metadata.inProgressSequences.isEmpty())
+                    {
+                        result = new Transformation.Rejected(INVALID, String.format("Committing %s would bump the serialization version from %s to %s," +
+                                                                                    " which is not allowed when having ongoing multi step operations (%s) - see CASSANDRA-XYZ",

Review Comment:
   can we get an actual ticket number for this ? 



-- 
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-unsubscribe@cassandra.apache.org

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


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