Marcus Eriksson created CASSANDRA-21043:
-------------------------------------------
Summary: Refactor the way we check if a transformation is allowed
to be committed during upgrades
Key: CASSANDRA-21043
URL: https://issues.apache.org/jira/browse/CASSANDRA-21043
Project: Apache Cassandra
Issue Type: Improvement
Components: Transactional Cluster Metadata
Reporter: Marcus Eriksson
Assignee: Marcus Eriksson
Currently the way we check if a transformation is allowed to be committed
during metadata serialization upgrades is to call the {{allowDuringUpgrades}}
method, which only returns true for {{Startup}} and {{TriggerSnapshot}}
transformations. This means that all other transformations will be disallowed
if the metadata serialization version changed, which we allow in minor upgrades.
This is overly defensive and we can relax this to only disallow committing
completely new transformations since non-upgraded nodes would not be able to
deserialize them. Modified transformations must be backwards compatible to be
committed, and will be serialized using the oldest serialization version
present in the cluster.
This patch adds an {{introducedIn}} field on the {{Transformation.Kind}} enum.
This allows old transformations to be committed by comparing it with the
cluster min version. For more flexibility, a transformation can also override
the {{eligibleToCommit}} method to be able to check if the current cluster
metadata allows the transformation.
Specifically for new schema transformations, a {{compatibleWith}} method has to
be implemented. This method should also handle modified schema transformations
to make sure non-upgraded nodes can still execute them. See javadoc on the
{{SchemaTransformation.compatibleWith}} method for more details.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]