apache/cassandra · critical · CorruptSSTableException

Failed to read partition index

Error message

Failed to read partition index

What it means

During `nodetool verify --check-data` index validation, deserializeIndex walks the entire partition index via KeyReader and confirms the final key equals the SSTable's last decorated key. If the index cannot be read to the end or the last index key doesn't match the expected last key, it throws CorruptSSTableException('Failed to read partition index').

Source

Thrown at src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java:398

        {
            if (outputHandler.isDebugEnabled()) outputHandler.debug("Deserializing index for %s", sstable);
            deserializeIndex(sstable);
        }
        catch (Throwable t)
        {
            outputHandler.warn(t);
            markAndThrow(t);
        }
    }

    protected void deserializeIndex(SSTableReader sstable) throws IOException
    {
        try (KeyReader it = sstable.keyReader())
        {
            ByteBuffer last = it.key();
            while (it.advance()) last = it.key(); // no-op, just check if index is readable
            if (!Objects.equals(last, sstable.getLast().getKey()))
                throw new CorruptSSTableException(new IOException("Failed to read partition index"), it.toString());
        }
    }

    @Override
    public void close()
    {
        fileAccessLock.writeLock().lock();
        try
        {
            FileUtils.closeQuietly(dataFile);
        }
        finally
        {
            fileAccessLock.writeLock().unlock();
        }
    }

    /**

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Run `nodetool repair` after removing/scrubbing the affected SSTable so good replicas replace it.
  2. Run `nodetool scrub` to salvage what is readable.
  3. Check the backup/transfer: re-copy all SSTable components of that generation together (Data.db, Index.db, Summary.db, TOC.txt).
  4. Investigate underlying disk health if corruption repeats.

Example fix

// before: verify reports unreadable partition index
nodetool verify keyspace1 standard1
// after
nodetool scrub keyspace1 standard1
nodetool repair keyspace1
Defensive patterns

Strategy: try-catch

Try / catch

try {
    verifier.verify();
} catch (CorruptSSTableException e) {
    // index unreadable: scrub then repair
    runScrub(keyspace, table);
    runRepair(keyspace, table);
}

Prevention

When it happens

Trigger: Index file (Summary.db/Index.db) truncated or corrupted so KeyReader.advance() throws or terminates early, or the last indexed key no longer equals sstable.getLast().getKey() — e.g. damaged Index.db, bad summary, tampered files.

Common situations: Disk corruption/bitrot, crash during compaction leaving a half-written index, files copied incompletely between nodes, restoring inconsistent backup pieces (data file without matching index).

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/cf9c818e7f6e5236. Report an issue: GitHub.