apache/cassandra · error

Your replication factor

Error message

Your replication factor {} for keyspace {} is higher than the number of nodes {}

What it means

Guardrail warning raised in SimpleStrategy.maybeWarnOnOptions: the keyspace's replication factor exceeds the current number of nodes in the cluster, so some replicas of each row cannot exist. Skipped for system keyspaces and when nodeCount is 0 (common in tests).

Solutions

  1. Lower the replication factor via ALTER KEYSPACE to match or stay below node count.
  2. Add nodes to the cluster if higher redundancy is intended.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/locator/SimpleStrategy.java:154 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/03bc416e78f44b18. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/locator/SimpleStrategy.java:154

    }

    @Override
    public void maybeWarnOnOptions(ClientState state)
    {
        if (!SchemaConstants.isSystemKeyspace(keyspaceName))
        {
            int nodeCount = StorageService.instance.getHostIdToEndpoint().size();
            // nodeCount==0 on many tests
            Guardrails.minimumReplicationFactor.guard(rf.fullReplicas, keyspaceName, false, state);
            Guardrails.maximumReplicationFactor.guard(rf.fullReplicas, keyspaceName, false, state);
            if (rf.fullReplicas > nodeCount && nodeCount != 0)
            {
                String msg = "Your replication factor " + rf.fullReplicas
                             + " for keyspace "
                             + keyspaceName
                             + " is higher than the number of nodes "
                             + nodeCount;
                ClientWarn.instance.warn(msg);
                logger.warn(msg);
            }
        }
    }

    @Override
    public Collection<String> recognizedOptions(ClusterMetadata metadata)
    {
        return Collections.singleton(REPLICATION_FACTOR);
    }

    @SuppressWarnings("unused") // used via reflection
    protected static void prepareOptions(Map<String, String> options, Map<String, String> previousOptions)
    {
        // When altering from NTS to SS, previousOptions could have multiple different RFs for different data centers - so we
        // will instead default to DefaultRF configuration if RF is not mentioned with the alter statement
        String rf = previousOptions.containsKey(REPLICATION_FACTOR) ? previousOptions.get(REPLICATION_FACTOR)
                                                                    : Integer.toString(DatabaseDescriptor.getDefaultKeyspaceRF());

View on GitHub (pinned to 88fd0f6a0e)