{"record":{"id":"ebf1b93a2dd584e7","repo":"apache/cassandra","slug":"cannot-open-s-partitioner-s-does-not-match-syst","errorCode":null,"errorMessage":"Cannot open %s; partitioner %s does not match system partitioner %s. Note that the default partitioner starting with Cassandra 1.2 is Murmur3Partitioner, so you will need to edit that to match your old partitioner if upgrading.","messagePattern":"Cannot open (.+?); partitioner (.+?) does not match system partitioner (.+?)\\. Note that the default partitioner starting with Cassandra 1\\.2 is Murmur3Partitioner, so you will need to edit that to match your old partitioner if upgrading\\.","errorType":"exception","errorClass":"CorruptSSTableException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/io/sstable/format/SSTableReaderLoadingBuilder.java","lineNumber":130,"sourceCode":"            throw new CorruptSSTableException(ex, descriptor.baseFile());\n        }\n    }\n\n    public abstract KeyReader buildKeyReader(TableMetrics tableMetrics) throws IOException;\n\n    protected abstract void openComponents(B builder, SSTable.Owner owner, boolean validate, boolean online) throws IOException;\n\n    /**\n     * Check if sstable is created using same partitioner.\n     * Partitioner can be null, which indicates older version of sstable or no stats available.\n     * In that case, we skip the check.\n     */\n    protected void validatePartitioner(TableMetadata metadata, ValidationMetadata validationMetadata)\n    {\n        String partitionerName = metadata.partitioner.getClass().getCanonicalName();\n        if (validationMetadata != null && !partitionerName.equals(validationMetadata.partitioner))\n        {\n            throw new CorruptSSTableException(new IOException(String.format(\"Cannot open %s; partitioner %s does not match system partitioner %s. \" +\n                                                                            \"Note that the default partitioner starting with Cassandra 1.2 is Murmur3Partitioner, \" +\n                                                                            \"so you will need to edit that to match your old partitioner if upgrading.\",\n                                                                            descriptor, validationMetadata.partitioner, partitionerName)),\n                                              descriptor.fileFor(Components.STATS));\n        }\n    }\n\n    private TableMetadataRef resolveTableMetadataRef()\n    {\n        TableMetadataRef metadata;\n        if (descriptor.cfname.contains(SECONDARY_INDEX_NAME_SEPARATOR))\n        {\n            int i = descriptor.cfname.indexOf(SECONDARY_INDEX_NAME_SEPARATOR);\n            String indexName = descriptor.cfname.substring(i + 1);\n            metadata = Schema.instance.getIndexMetadata(descriptor.ksname, indexName).map(m -> m.ref).orElse(null);\n            if (metadata == null)\n                throw new AssertionError(\"Could not find index metadata for index cf \" + i);\n        }","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/SSTableReaderLoadingBuilder.java#L112-L148","documentation":"validatePartitioner() compares the partitioner recorded in the SSTable's Validation metadata (Statistics.db) with the partitioner of the table being opened. A mismatch means the SSTable's token ordering is incompatible with the table's partitioner, so it throws CorruptSSTableException pointing at the stats component, with guidance about Murmur3Partitioner being the default since 1.2.","triggerScenarios":"Opening/loading an SSTable whose ValidationMetadata.partitioner differs from metadata.partitioner — e.g. loading SSTables written under RandomPartitioner/ByteOrderedPartitioner into a Murmur3 table, or cassandra.yaml partitioner changed between cluster versions.","commonSituations":"Upgrades from pre-1.2 clusters with edited/unchanged partitioner settings; copying SSTables between clusters configured with different partitioners; pointing tools at foreign SSTable directories.","solutions":["Set the table/cluster partitioner to match the SSTable's (edit partitioner in cassandra.yaml or table metadata) — only viable if reconfiguring is acceptable","Rewrite the SSTables with sstableloader into a cluster/table using the correct partitioner","Verify the recorded partitioner via sstablemetadata <data-file> before loading","If truly incompatible, discard and rebuild the data via repair from replicas"],"exampleFix":"// before: cassandra.yaml with leftover old partitioner\npartitioner: org.apache.cassandra.dht.RandomPartitioner\n// after\npartitioner: org.apache.cassandra.dht.Murmur3Partitioner","handlingStrategy":"validation","validationCode":"// compare partitioners before loading\nString sstablePartitioner = sstablemetadata(dataFile).partitioner;\nString tablePartitioner = metadata.partitioner.getClass().getCanonicalName();\nif (!sstablePartitioner.equals(tablePartitioner)) { fixConfigOrRewrite(); }","typeGuard":null,"tryCatchPattern":"try { SSTableReader.open(descriptor, components, metadata); }\ncatch (CorruptSSTableException e) {\n    if (e.getMessage().contains(\"partitioner\") && e.getMessage().contains(\"does not match\")) {\n        logger.error(\"Partitioner mismatch for {}\", descriptor);\n        alignPartitionerConfigOrUseSstableloader();\n    } else throw e;\n}","preventionTips":["Keep partitioner: Murmur3Partitioner in cassandra.yaml on all modern clusters","Check sstablemetadata partitioner before loading foreign SSTables","Never change partitioner on existing data; migrate via sstableloader instead","Ensure all nodes in a cluster use the same partitioner"],"tags":["sstable","partitioner","configuration-mismatch"],"backgroundTag":"invalid-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}