beobal commented on code in PR #3967:
URL: https://github.com/apache/cassandra/pull/3967#discussion_r1993151283


##########
src/java/org/apache/cassandra/schema/SchemaKeyspace.java:
##########
@@ -140,6 +140,7 @@ private SchemaKeyspace()
               + "clustering_order text,"
               + "column_name_bytes blob,"
               + "kind text,"
+              + "unique_id int,"

Review Comment:
   One way we have done schema evolution previously is to implement a listener 
which performs the schema changes when the min version in the cluster goes 
above a target version (i.e. when all nodes are upgraded). In this case, we 
were adding new tables to a distributed system keyspace, so could action the 
schema change by simply committing a set of "CREATE TABLE..." statements. 
Committing those in the same way as any other DDL ensures they happen on the 
same epoch across the cluster.  
   
   To do something similar here, we would implement a transformation to do the 
uid assignment and commit that in a listener. I imagine the trigger conditions 
in the listener would be:
   1. cluster min version > x
   2. uids are not already assigned
   correctly identifying 2. could have sharp edges, but simply inspecting any 
TableMetadata in the existing ClusterMetadata would probably do it.
   
   In this case the transformation wouldn't need be a DDL statement of course, 
it would just transform the TableMetadatas directly.
    



-- 
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]

Reply via email to