beobal commented on code in PR #4395:
URL: https://github.com/apache/cassandra/pull/4395#discussion_r2611535707
##########
src/java/org/apache/cassandra/cql3/statements/schema/AlterKeyspaceStatement.java:
##########
@@ -87,6 +87,15 @@ public Keyspaces apply(ClusterMetadata metadata)
if (attrs.getReplicationStrategyClass() != null &&
attrs.getReplicationStrategyClass().equals(SimpleStrategy.class.getSimpleName()))
Guardrails.simpleStrategyEnabled.ensureEnabled(state);
+ if (newKeyspace.params.replicationType.isTracked() &&
!keyspace.params.replicationType.isTracked())
+ {
+ if (SchemaConstants.isSystemKeyspace(keyspaceName))
+ throw ire("Mutation tracking is not supported on system
keyspaces");
+
+ if (!DatabaseDescriptor.getMutationTrackingEnabled())
Review Comment:
We'll need to move this, and probably some of the other pre-existing
validation, out of `apply` and into `validate`.
DDL statements are encoded as entries in the metadata log and once committed
must be able to be applied by all nodes, so divergent config across instances
would create an issue here.
Also, log entries may be replayed after a bounce and changes to config could
interfere with that & prevent the node from coming back up (c.f.
CASSANDRA-20452)
##########
src/java/org/apache/cassandra/cql3/statements/schema/CreateKeyspaceStatement.java:
##########
@@ -83,6 +84,17 @@ public Keyspaces apply(ClusterMetadata metadata)
KeyspaceMetadata keyspaceMetadata =
KeyspaceMetadata.create(keyspaceName, attrs.asNewKeyspaceParams());
+ if (keyspaceMetadata.params.replicationType.isTracked())
+ {
+ if (SchemaConstants.isSystemKeyspace(keyspaceName))
+ throw ire("Mutation tracking is not supported on system
keyspaces");
+
+ if (!DatabaseDescriptor.getMutationTrackingEnabled())
Review Comment:
Same point as on `AlterKeyspaceStatement` applies here
--
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]