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


##########
src/java/org/apache/cassandra/cql3/statements/schema/AlterKeyspaceStatement.java:
##########
@@ -128,14 +142,21 @@ private void validateNoRangeMovements()
         if (allow_alter_rf_during_range_movement)
             return;
 
-        Stream<InetAddressAndPort> unreachableNotAdministrativelyInactive =
-            Gossiper.instance.getUnreachableMembers().stream().filter(endpoint 
-> !FBUtilities.getBroadcastAddressAndPort().equals(endpoint) &&
-                                                                      
!Gossiper.instance.isAdministrativelyInactiveState(endpoint));
-        Stream<InetAddressAndPort> endpoints = 
Stream.concat(Gossiper.instance.getLiveMembers().stream(),
-                                                             
unreachableNotAdministrativelyInactive);
-        List<InetAddressAndPort> notNormalEndpoints = 
endpoints.filter(endpoint -> 
!FBUtilities.getBroadcastAddressAndPort().equals(endpoint) &&
-                                                                               
    !Gossiper.instance.getEndpointStateForEndpoint(endpoint).isNormalState())
-                                                               
.collect(Collectors.toList());
+        ClusterMetadata metadata = ClusterMetadata.current();

Review Comment:
   Referring `ClusterMetadata.current()` from the transformation code is wrong, 
so as referring to the configuration, `DatabaseDescriptor`, `Gossiper` and 
others. This can be seen in many schema transformations and makes the 
transformations non-pure. In turn, it can make replaying the log lead to 
inconsistent metadata for the same epoch on different nodes.



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