netudima commented on code in PR #4282:
URL: https://github.com/apache/cassandra/pull/4282#discussion_r2262608841
##########
src/java/org/apache/cassandra/cql3/statements/schema/CreateKeyspaceStatement.java:
##########
@@ -82,6 +82,13 @@ public Keyspaces apply(ClusterMetadata metadata)
}
KeyspaceMetadata keyspaceMetadata =
KeyspaceMetadata.create(keyspaceName, attrs.asNewKeyspaceParams());
+ // we deduplicate ReplicationParams here to use the same objects in
KeyspaceMetadata
+ // as we have as keys in metadata.placements to have a fast map lookup
+ // ReplicationParams are immutable, so it is a safe optimization
+ KeyspaceParams keyspaceParams = keyspaceMetadata.params;
+ ReplicationParams replicationParams =
metadata.placements.deduplicateReplicationParams(keyspaceParams.replication);
Review Comment:
Hi @beobal, thank you for the checking the change. Yes, I see, I have
checked that the deduplication is applied during an initial creation or
altering keyspace, as well as on startup (but only a recent one, so it was a
log replay path, not a snapshot path).
Let me re-measure to see the remaining cost of the equals after other
changes applied.
Regarding the snapshot logic, am I right that this path is going through:
org.apache.cassandra.tcm.ClusterMetadata.Serializer#deserialize ?
--
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]