Github user ifesdjeen commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/224#discussion_r197124486
  
    --- Diff: 
src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java ---
    @@ -96,7 +98,35 @@ private void warnIfIncreasingRF(KeyspaceMetadata ksm, 
KeyspaceParams params)
                                                                                
                             StorageService.instance.getTokenMetadata(),
                                                                                
                             DatabaseDescriptor.getEndpointSnitch(),
                                                                                
                             params.replication.options);
    -        if (newStrategy.getReplicationFactor() > 
oldStrategy.getReplicationFactor())
    +
    +        validateTransientReplication(oldStrategy, newStrategy);
    +        warnIfIncreasingRF(oldStrategy, newStrategy);
    +    }
    +
    +    private void validateTransientReplication(AbstractReplicationStrategy 
oldStrategy, AbstractReplicationStrategy newStrategy)
    +    {
    +        if (oldStrategy.getReplicationFactor().trans == 0 && 
newStrategy.getReplicationFactor().trans > 0)
    --- End diff --
    
    We can compare with `!=` (possibly only in the second case).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to