{"record":{"id":"00c83e7a7a50dbac","repo":"apache/cassandra","slug":"partitioner-does-not-match-validation-metadata","errorCode":null,"errorMessage":"Partitioner does not match validation metadata","messagePattern":"Partitioner does not match validation metadata","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java","lineNumber":197,"sourceCode":"            if (outputHandler.isDebugEnabled()) outputHandler.debug(\"Deserializing bloom filter for %s\", sstable);\n            deserializeBloomFilter(sstable);\n        }\n        catch (Throwable t)\n        {\n            outputHandler.warn(t);\n            markAndThrow(t);\n        }\n    }\n\n    protected void verifySSTableMetadata()\n    {\n        outputHandler.output(\"Deserializing sstable metadata for %s \", sstable);\n        try\n        {\n            StatsComponent statsComponent = StatsComponent.load(sstable.descriptor, MetadataType.VALIDATION, MetadataType.STATS, MetadataType.HEADER);\n            if (statsComponent.validationMetadata() != null &&\n                !statsComponent.validationMetadata().partitioner.equals(sstable.getPartitioner().getClass().getCanonicalName()))\n                throw new IOException(\"Partitioner does not match validation metadata\");\n        }\n        catch (Throwable t)\n        {\n            outputHandler.warn(t);\n            markAndThrow(t, false);\n        }\n    }\n\n    protected void verifySSTableVersion()\n    {\n        outputHandler.output(\"Verifying %s (%s)\", sstable, FBUtilities.prettyPrintMemory(dataFile.length()));\n        if (options.checkVersion && !sstable.descriptor.version.isLatestVersion())\n        {\n            String msg = String.format(\"%s is not the latest version, run upgradesstables\", sstable);\n            outputHandler.output(msg);\n            // don't use markAndThrow here because we don't want a CorruptSSTableException for this.\n            throw new RuntimeException(msg);\n        }","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java#L179-L215","documentation":"During `nodetool verify`, the partitioner recorded in the SSTable's Validation metadata (stats.db) is compared against the partitioner the node is currently configured to use. If they differ, an IOException is thrown and passed to markAndThrow, marking the SSTable invalid. This guards against reading files written under an incompatible tokenization scheme.","triggerScenarios":"Loading an SSTable whose ValidationMetadata.partitioner differs from DatabaseDescriptor's configured partitioner class — e.g. sstable copied from a cluster using a different partitioner, or cassandra.yaml partitioner changed after the file was written.","commonSituations":"Restoring backups/snapshots into a cluster with a different partitioner; migrating data between clusters with mismatched configs; accidentally changing partitioner in cassandra.yaml (which is unsupported without a full reload).","solutions":["Ensure cassandra.yaml partitioner matches the one the SSTables were written with (usually Murmur3Partitioner).","Do not copy SSTables between clusters with different partitioners; re-stream data instead (repair, sstableloader, or re-import).","If the file is truly foreign, remove it and let repair restore correct data.","Run `sstablemetadata <file>` to inspect the recorded partitioner."],"exampleFix":"// before: mismatched config in cassandra.yaml\npartitioner: org.apache.cassandra.dht.ByteOrderedPartitioner\n// after\ndivpartitioner: org.apache.cassandra.dht.Murmur3Partitioner","handlingStrategy":"validation","validationCode":"// Java: compare partitioners before loading foreign sstables\nString recorded = StatsComponent.load(desc, MetadataType.VALIDATION).validationMetadata().partitioner;\nString current = DatabaseDescriptor.getPartitioner().getClass().getCanonicalName();\nif (!recorded.equals(current)) throw new IllegalStateException(\"Partitioner mismatch: \" + recorded + \" vs \" + current);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep partitioner identical across all clusters you exchange data with (default Murmur3Partitioner)","Inspect sstablemetadata output before restoring foreign files","Never edit partitioner in cassandra.yaml on an existing cluster"],"tags":["sstable","partitioner","verification","configuration"],"backgroundTag":"schema-validation-failed","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"}