Skip to content

Commit 3bcc8d5

Browse files
committed
CEP-58: Add satellite replication strategy stub
Patch by Blake Eggleston; Reviewed by Caleb Rackliffe for CASSANDRA-21105
1 parent a5116b9 commit 3bcc8d5

File tree

5 files changed

+1477
-3
lines changed

5 files changed

+1477
-3
lines changed

src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,11 @@ protected void validateReplicationFactor(String s) throws ConfigurationException
372372
try
373373
{
374374
ReplicationFactor rf = ReplicationFactor.fromString(s);
375-
375+
376376
if (rf.hasTransientReplicas())
377377
{
378+
if (rf.fullReplicas == 0)
379+
throw new ConfigurationException("Replication factor must have at least one full replica, got " + s);
378380
if (DatabaseDescriptor.getNumTokens() > 1)
379381
throw new ConfigurationException("Transient replication is not supported with vnodes yet");
380382
if (!replicationType.isTracked())

src/java/org/apache/cassandra/locator/ReplicationFactor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ static void validate(int totalRF, int transientRF)
6565
"Transient replication is not enabled on this node");
6666
Preconditions.checkArgument(totalRF >= 0,
6767
"Replication factor must be non-negative, found %s", totalRF);
68-
Preconditions.checkArgument(transientRF == 0 || transientRF < totalRF,
69-
"Transient replicas must be zero, or less than total replication factor. For %s/%s", totalRF, transientRF);
68+
Preconditions.checkArgument(transientRF <= totalRF,
69+
"Transient replicas must be less than or equal to total replication factor. For %s/%s", totalRF, transientRF);
7070
if (transientRF > 0)
7171
{
7272
Preconditions.checkArgument(DatabaseDescriptor.getNumTokens() == 1,

0 commit comments

Comments
 (0)