apache/cassandra · error · IOException

Invalid large Columns subset: present index ${idx} of ${supe

Error message

Invalid large Columns subset: present index ${idx} of ${supersetCount}

What it means

Thrown by UnfilteredDescriptor.readPresentColumnIndexes when deserializing the 'present columns' bitmap of a large-columns subset encoding: an index read from the data stream is negative or >= the superset column count. This means the on-disk bytes are inconsistent with the Columns superset metadata — i.e. the SSTable component is corrupt, truncated, or was written by an incompatible format version. It surfaces as an IOException during partition deserialization.

Source

Thrown at src/java/org/apache/cassandra/io/sstable/UnfilteredDescriptor.java:214

            presentColumnsWords = new long[nWords];

        if (columnCount < supersetCount / 2)
            readPresentColumnIndexes(dataReader, supersetCount, nWords, columnCount);
        else
            readMissingColumnIndexes(dataReader, supersetCount, nWords, delta);

        useColumnsWords = true;
        missingColumnsMask = 0;
    }

    private void readPresentColumnIndexes(RandomAccessReader dataReader, int supersetCount, int nWords, int columnCount) throws IOException
    {
        java.util.Arrays.fill(presentColumnsWords, 0, nWords, 0L);
        for (int i = 0; i < columnCount; i++)
        {
            int idx = dataReader.readUnsignedVInt32();
            if (idx < 0 || idx >= supersetCount)
                throw new IOException("Invalid large Columns subset: present index " + idx + " of " + supersetCount);
            presentColumnsWords[idx >>> 6] |= 1L << (idx & 63);
        }
    }

    /** The last word starts trimmed to the column range. A delta of 0 clears nothing. */
    private void readMissingColumnIndexes(RandomAccessReader dataReader, int supersetCount, int nWords, int delta) throws IOException
    {
        java.util.Arrays.fill(presentColumnsWords, 0, nWords, -1L);
        if ((supersetCount & 63) != 0)
            presentColumnsWords[nWords - 1] = -1L >>> (64 - (supersetCount & 63));
        for (int i = 0; i < delta; i++)
        {
            int idx = dataReader.readUnsignedVInt32();
            if (idx < 0 || idx >= supersetCount)
                throw new IOException("Invalid large Columns subset: missing index " + idx + " of " + supersetCount);
            presentColumnsWords[idx >>> 6] &= ~(1L << (idx & 63));
        }
    }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Run nodetool scrub (or sstablescrub) on the affected keyspace/table to repair or quarantine the corrupt SSTable
  2. Restore the affected SSTable from a verified backup/snapshot and let repair/anti-entropy rebuild the data
  3. Run sstablemetadata / sstableverify on the file to confirm which component is corrupt before deleting
  4. Check disk health and filesystem errors (dmesg, SMART) and verify disk space to rule out failed flushes
Defensive patterns

Strategy: try-catch

Validate before calling

// Before opening: validate SSTable components
sstableverify -- <keyspace> <table>  // or use sstablemetadata on each Descriptor
descriptor.fileFor(Component.DATA).exists();

Try / catch

try (UnfilteredRowIterator it = sstable.iterator(...)) { ... }
catch (CorruptSSTableException | IOException e) {
    logger.error("Corrupt SSTable {}, quarantine and repair", sstable, e);
    // mark bad, trigger nodetool scrub/repair
}

Prevention

When it happens

Trigger: Reading an SSTable row whose serialization header declares a large column superset, while the encoded present-index vint stream contains an out-of-range index (corrupt/truncated data file, wrong serialization header, bit-flip or partial write).

Common situations: Hardware corruption or incomplete writes to data.db; copying/mixing SSTable files from different snapshots or Cassandra versions; restoring a backup where data.db and serialization header mismatch; disk full during flush.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/ff173cd72be1f1bb. Report an issue: GitHub.