{"record":{"id":"26c2e98784cfbf15","repo":"apache/cassandra","slug":"invalid-large-columns-subset-missing-index-idx","errorCode":null,"errorMessage":"Invalid large Columns subset: missing index ${idx} of ${supersetCount}","messagePattern":"Invalid large Columns subset: missing index (.+?) of (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/io/sstable/UnfilteredDescriptor.java","lineNumber":229,"sourceCode":"        {\n            int idx = dataReader.readUnsignedVInt32();\n            if (idx < 0 || idx >= supersetCount)\n                throw new IOException(\"Invalid large Columns subset: present index \" + idx + \" of \" + supersetCount);\n            presentColumnsWords[idx >>> 6] |= 1L << (idx & 63);\n        }\n    }\n\n    /** The last word starts trimmed to the column range. A delta of 0 clears nothing. */\n    private void readMissingColumnIndexes(RandomAccessReader dataReader, int supersetCount, int nWords, int delta) throws IOException\n    {\n        java.util.Arrays.fill(presentColumnsWords, 0, nWords, -1L);\n        if ((supersetCount & 63) != 0)\n            presentColumnsWords[nWords - 1] = -1L >>> (64 - (supersetCount & 63));\n        for (int i = 0; i < delta; i++)\n        {\n            int idx = dataReader.readUnsignedVInt32();\n            if (idx < 0 || idx >= supersetCount)\n                throw new IOException(\"Invalid large Columns subset: missing index \" + idx + \" of \" + supersetCount);\n            presentColumnsWords[idx >>> 6] &= ~(1L << (idx & 63));\n        }\n    }\n\n    public void resetUnfiltered()\n    {\n        resetClustering();\n        position = 0;\n        flags = 0;\n        extendedFlags = 0;\n        unfilteredSize = 0;\n        unfilteredDataStart = 0;\n        prevUnfilteredSize = 0;\n        rowColumns = null;\n        missingColumnsMask = 0;\n        useColumnsWords = false;\n    }\n","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/UnfilteredDescriptor.java#L211-L247","documentation":"Thrown by UnfilteredDescriptor.readMissingColumnIndexes when deserializing the 'missing columns' delta list of a large-columns subset: an index read from the stream is negative or >= the superset column count. Like the present-index check, it indicates the serialized column bitmap on disk cannot be valid for the declared superset, i.e. corrupted or mismatched SSTable data.","triggerScenarios":"Reading an SSTable row with the large-columns subset encoding where the trailing missing-index vints fall outside [0, supersetCount): truncated or corrupt data.db bytes, or a serialization-header/column-count mismatch between the file and the table schema.","commonSituations":"Corrupt or partially flushed SSTables; mixing SSTables across versions or schema snapshots; failed compaction left a bad file; manual file edits or bad restore.","solutions":["Run nodetool scrub / sstablescrub on the table to validate and quarantine the corrupt file","Restore the SSTable from a snapshot/backup and repair the range with nodetool repair","Use sstableverify to identify the bad component and remove it so it can be re-rebuilt from replicas","Verify schema/serialization-header consistency; upgrade path issues may need recompacting with the current version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate file integrity before deserialization\nsstableverify <keyspace> <table>\nsstablemetadata <data.db file>","typeGuard":null,"tryCatchPattern":"try { readRow(...); }\ncatch (CorruptSSTableException | IOException e) {\n    quarantine(sstable); // move to bad/, then nodetool scrub + repair\n}","preventionTips":["Use snapshots for backup/restore, never partial file copies","Scrub after unclean shutdowns","Keep consistent versions across the cluster","Alert on checksum/verify failures early"],"tags":["sstable","corruption","io","deserialization"],"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"}