{"record":{"id":"b596a9aceba94f1e","repo":"apache/cassandra","slug":"the-support-for-the-oldnetworktopologystrategy-has","errorCode":null,"errorMessage":"The support for the OldNetworkTopologyStrategy has been removed in C* version 4.0. The keyspace strategy should be switch to NetworkTopologyStrategy","messagePattern":"The support for the OldNetworkTopologyStrategy has been removed in C\\* version 4\\.0\\. The keyspace strategy should be switch to NetworkTopologyStrategy","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java","lineNumber":341,"sourceCode":"                                                   Map<String, String> strategyOptions,\n                                                   ClientState state) throws ConfigurationException\n    {\n        AbstractReplicationStrategy strategy = createInternal(keyspaceName, strategyClass, strategyOptions);\n        strategy.validateExpectedOptions(metadata);\n        strategy.validateOptions();\n        strategy.maybeWarnOnOptions(state);\n        if (strategy.hasTransientReplicas() && !DatabaseDescriptor.isTransientReplicationEnabled())\n        {\n            throw new ConfigurationException(\"Transient replication is disabled. Enable in cassandra.yaml to use.\");\n        }\n    }\n\n    public static Class<AbstractReplicationStrategy> getClass(String cls) throws ConfigurationException\n    {\n        String className = cls.contains(\".\") ? cls : \"org.apache.cassandra.locator.\" + cls;\n\n        if (\"org.apache.cassandra.locator.OldNetworkTopologyStrategy\".equals(className)) // see CASSANDRA-16301 \n            throw new ConfigurationException(\"The support for the OldNetworkTopologyStrategy has been removed in C* version 4.0. The keyspace strategy should be switch to NetworkTopologyStrategy\");\n\n        @SuppressWarnings(\"unchecked\")\n        Class<AbstractReplicationStrategy> strategyClass =\n            (Class<AbstractReplicationStrategy>) FBUtilities.classForNameWithoutInitialization(className,\n                                                                                             \"replication strategy\",\n                                                                                             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        {","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java#L323-L359","documentation":"getClass rejects the OldNetworkTopologyStrategy class name (removed in Cassandra 4.0 per CASSANDRA-16301) and throws ConfigurationException telling the user to switch to NetworkTopologyStrategy. The legacy RackUnawareStrategy/old topology behavior is no longer available at all.","triggerScenarios":"Running CREATE/ALTER KEYSPACE with replication = {'class':'OldNetworkTopologyStrategy'} or restoring a schema from a pre-3.x-era cluster that referenced it (fully-qualified or short name resolves to org.apache.cassandra.locator.OldNetworkTopologyStrategy).","commonSituations":"Migrating a very old cluster (pre-Cassandra 2.0 schema dumps) to 4.0+; scripts generated years ago still naming OldNetworkTopologyStrategy; restoring snapshots with legacy schema files.","solutions":["Replace OldNetworkTopologyStrategy with NetworkTopologyStrategy in the replication map","Define per-datacenter replication factors explicitly, e.g. {'class':'NetworkTopologyStrategy','dc1':'3'}","Rebuild keyspaces on the new strategy and run a full repair/rebuild of replicas","Update automation/schema migration scripts that reference the old class"],"exampleFix":"// before\nCREATE KEYSPACE ks WITH replication = {'class':'OldNetworkTopologyStrategy','replication_factor':'3'};\n// after\nCREATE KEYSPACE ks WITH replication = {'class':'NetworkTopologyStrategy','dc1':'3'};","handlingStrategy":"validation","validationCode":"// Reject legacy strategy names before applying schema\nString cls = (String) replication.get(\"class\");\nif (cls != null && cls.replace(\"org.apache.cassandra.locator.\", \"\").equals(\"OldNetworkTopologyStrategy\"))\n    throw new IllegalArgumentException(\"Use NetworkTopologyStrategy instead\");","typeGuard":null,"tryCatchPattern":"try {\n    session.execute(ddl);\n} catch (ConfigurationException e) {\n    if (e.getMessage().contains(\"OldNetworkTopologyStrategy\"))\n        logger.error(\"Legacy strategy in schema; migrate to NetworkTopologyStrategy\");\n}","preventionTips":["Scrub schema dumps and migration scripts for OldNetworkTopologyStrategy before upgrading to 4.0","Use NetworkTopologyStrategy with explicit per-DC RFs for all new keyspaces","Run schema validation tooling during version upgrades","Update infrastructure-as-code templates to current strategy names"],"tags":["replication","removed-feature","migration","configuration"],"backgroundTag":"unsupported-config-value","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"}