{"record":{"id":"4dec65bd3397f256","repo":"apache/cassandra","slug":"transient-replication-is-not-supported-with-vnodes-4dec65","errorCode":null,"errorMessage":"Transient replication is not supported with vnodes yet","messagePattern":"Transient replication is not supported with vnodes yet","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java","lineNumber":365,"sourceCode":"                                                                                             AbstractReplicationStrategy.class);\n        return strategyClass;\n    }\n\n    public boolean hasSameSettings(AbstractReplicationStrategy other)\n    {\n        return getClass().equals(other.getClass()) && getReplicationFactor().equals(other.getReplicationFactor());\n    }\n\n    protected void validateReplicationFactor(String s) throws ConfigurationException\n    {\n        try\n        {\n            ReplicationFactor rf = ReplicationFactor.fromString(s);\n            \n            if (rf.hasTransientReplicas())\n            {\n                if (DatabaseDescriptor.getNumTokens() > 1)\n                    throw new ConfigurationException(\"Transient replication is not supported with vnodes yet\");\n            }\n        }\n        catch (IllegalArgumentException e)\n        {\n            throw new ConfigurationException(e.getMessage());\n        }\n    }\n\n    public void validate(ClusterMetadata snapshot) throws ConfigurationException\n    {\n        validateExpectedOptions(snapshot);\n        validateOptions();\n        maybeWarnOnOptions();\n        if (hasTransientReplicas() && !DatabaseDescriptor.isTransientReplicationEnabled())\n        {\n            throw new ConfigurationException(\"Transient replication is disabled. Enable in cassandra.yaml to use.\");\n        }\n    }","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java#L347-L383","documentation":"validateReplicationFactor parses the replication_factor string into a ReplicationFactor and, if the RF includes transient replicas, checks the node's num_tokens setting. Transient replication is only supported with a single token per node (see CASSANDRA-15260); with num_tokens > 1 (vnodes) it throws this ConfigurationException.","triggerScenarios":"Creating/altering a keyspace with RF like '5/1' (transient) on a cluster where num_tokens in cassandra.yaml is greater than 1.","commonSituations":"Testing transient replication on a vnode-based cluster (the default modern config uses multiple tokens); following transient replication docs without realizing the single-token requirement.","solutions":["Set num_tokens: 1 in cassandra.yaml (requires re-tokening the cluster) to use transient replication","Drop the transient portion of the RF (e.g. '5/1' -> '5') if staying on vnodes","Use a separate single-token cluster for transient replication experiments","Check num_tokens per datacenter (num_tokens_per_dc) if using per-DC token settings"],"exampleFix":"// before (cassandra.yaml)\nnum_tokens: 16\n// after\nnum_tokens: 1","handlingStrategy":"validation","validationCode":"// Transient RF requires single-token nodes\nif (rfString.contains(\"/\") && numTokens > 1)\n    throw new IllegalArgumentException(\"Transient replication requires num_tokens=1\");","typeGuard":null,"tryCatchPattern":"try {\n    session.execute(\"CREATE KEYSPACE ks WITH replication = {'class':'SimpleStrategy','replication_factor':'5/1'}\");\n} catch (ConfigurationException e) {\n    logger.error(\"Transient RF unsupported here: {}\", e.getMessage());\n}","preventionTips":["Only attempt transient replication on single-token (num_tokens=1) clusters","Plan re-tokening before adopting transient replication","Keep RF strings without '/' when running vnodes","Record token layout (num_tokens per DC) in cluster documentation"],"tags":["replication","vnodes","transient-replication","configuration"],"backgroundTag":"conflicting-config-options","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}