jacek-lewandowski commented on code in PR #2795:
URL: https://github.com/apache/cassandra/pull/2795#discussion_r1356484593


##########
src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java:
##########
@@ -132,8 +132,13 @@ public final ResultMessage execute(QueryState state, 
QueryOptions options, long
     @Override
     public ResultMessage executeLocally(QueryState state, QueryOptions options)
     {
-        Keyspaces keyspaces = Schema.instance.distributedAndLocalKeyspaces();
-        UUID schemaVersion = Schema.instance.getVersion();
+        UUID schemaVersion;
+        Keyspaces keyspaces;
+        do
+        {
+            schemaVersion = Schema.instance.getVersionSync();
+            keyspaces = Schema.instance.distributedAndLocalKeyspaces();

Review Comment:
   Actually, I don't think this is a case - it is not waiting here for the 
cluster schema to be consistent - it is only the local thing - when the schema 
gets transformed locally, the transformation is applied in a synchronized 
block. A single transformation may include multiple items which are applied one 
by one immediately updating the snapshot. On the other hand, scheme version is 
updated once after the whole transformation is completed. So, here we are just 
waiting for that synchronized block to complete and make sure that no other 
synchronized transformation has started in the meantime. In other words, 
waiting to make sure the metadata and version pertains to the same schema.



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