{"record":{"id":"404abf0a0d56c15c","repo":"apache/cassandra","slug":"unfiltered-clustering-in-index-does-not-match-data","errorCode":null,"errorMessage":"Unfiltered clustering in index does not match data:{info=","messagePattern":"Unfiltered clustering in index does not match data:\\{info=","errorType":"exception","errorClass":"CorruptSSTableException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/io/sstable/format/big/BigTableVerifier.java","lineNumber":160,"sourceCode":"                    {\n                        IndexInfo indexInfo = indexInfoRetriever.columnsIndex(blockIndex);\n                        if (outputHandler.isDebugEnabled()) outputHandler.debug(\"indexInfo %s\", indexInfo.toString(sstable.metadata()));\n\n                        long dataFileOffset = partitionBase + indexInfo.offset;\n                        if (expectedNextOffset != 0)\n                        {\n                            if (expectedNextOffset != indexInfo.offset)\n                                throw new CorruptSSTableException(new IOException(\"Row entry indexInfo offset + width should match next block offset:\" + indexInfo.offset + \" expected: \" + expectedNextOffset), it.toString());\n                        }\n                        expectedNextOffset = indexInfo.offset + indexInfo.width;\n                        dataFile.seek(dataFileOffset);\n\n                        Unfiltered unfiltered = UnfilteredSerializer.serializer.deserialize(dataFile,\n                                                                                            sstable.header,\n                                                                                            deserializationHelper,\n                                                                                            BTreeRow.sortedBuilder());\n                        if (!Objects.equals(indexInfo.firstName, unfiltered.clustering()))\n                            throw new CorruptSSTableException(new IOException(\"Unfiltered clustering in index does not match data:{info=\" + indexInfo.toString(sstable.metadata()) + \", row:\" + unfiltered.clustering().toString(sstable.metadata()) + \"}\"), it.toString());\n\n                        if (comparator.compare(indexInfo.firstName, indexInfo.lastName) > 0)\n                            throw new CorruptSSTableException(new IOException(\"First name is > Last name:{info=\" + indexInfo.toString(sstable.metadata()) + \"}\"), it.toString());\n\n                    }\n                }\n            }\n            // The verifier checks that the partition key/position in the index and data match, here we waant to verify\n            // the entries clustering keys match.\n            while (it.advance()); // no-op, just check if index is readable\n\n            if (!Objects.equals(key, sstable.getLast().getKey()))\n                throw new CorruptSSTableException(new IOException(\"Last partition does not match index\"), it.toString());\n        }\n        if (options.extendedVerification)\n            dataFile.reset();\n    }\n","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/big/BigTableVerifier.java#L142-L178","documentation":"Thrown during extended verification when the clustering key of the unfiltered row deserialized from the data file does not match the firstName recorded for that indexInfo entry in the row index. Index and data content disagree, indicating corruption.","triggerScenarios":"`nodetool verify` (extendedVerification) where deserializing the row at partitionBase+indexInfo.offset yields a clustering different from indexInfo.firstName.","commonSituations":"Truncated or corrupted Data.db from crashes or disk issues; SSTables manually copied while being written; filesystem corruption.","solutions":["Scrub the SSTable or delete it and repair the affected token range from replicas","Restore the SSTable from a clean backup","Verify disk/filesystem health (fsck, SMART)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { verifier.verify(); }\ncatch (CorruptSSTableException e) { logger.error(\"Index/data clustering mismatch in {}\", e.getFilename()); repairRange(keyspace, table); }","preventionTips":["Avoid raw copies of live SSTables","Verify after any file-level restore","Maintain replicas and run regular nodetool repair so corrupted SSTables can be replaced","Check disk for silent corruption"],"tags":["sstable","corruption","verifier","clustering"],"backgroundTag":"checksum-mismatch","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"}