cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aweisberg <...@git.apache.org>
Subject [GitHub] cassandra pull request #224: 14405 replicas
Date Wed, 16 May 2018 21:59:51 GMT
Github user aweisberg commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/224#discussion_r188785532
  
    --- 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)
    +        {
    +            Keyspace ks = Keyspace.open(keyspace());
    +            for (ColumnFamilyStore cfs: ks.getColumnFamilyStores())
    +            {
    +                if (cfs.viewManager.hasViews())
    +                {
    +                    throw new ConfigurationException("Cannot use transient replication
on keyspaces using materialized views");
    +                }
    +
    +                if (cfs.indexManager.hasIndexes())
    +                {
    +                    throw new ConfigurationException("Cannot use transient replication
on keyspaces using secondary indexes");
    +                }
    +            }
    +
    +        }
    +    }
    --- End diff --
    
    If you are decreasing the transient count who the full replicas are is unchanging? So
you don't need to move data around? You just need to fetch what you are about to lose from
the transients before you lose another replica?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message