apache/cassandra · error · CorruptIndexException

Postings list #%s block is corrupted. Bits per value should

Error message

Postings list #%s block is corrupted. Bits per value should be no more than 64 and is %d.

What it means

PostingsReader.readFoRBlock() reads a block's bits-per-value header; since frames-of-reference encoding packs values into at most 64 bits, any header value > 64 is impossible and signals a corrupted postings block. It throws a Lucene CorruptIndexException referencing the input file. A value of 0 is legal (all values identical).

Source

Thrown at src/java/org/apache/cassandra/index/sai/disk/v1/postings/PostingsReader.java:358

    private void readFoRBlock(IndexInput in) throws IOException
    {
        if (blockIndex == 0)
            actualPosting = in.readVLong();

        byte bitsPerValue = in.readByte();

        long currentPosition = in.getFilePointer();

        if (bitsPerValue == 0)
        {
            // If bitsPerValue is 0 then all the values in the block are the same
            currentFoRValues = LongValues.ZEROES;
            return;
        }
        else if (bitsPerValue > 64)
        {
            throw new CorruptIndexException(
            String.format("Postings list #%s block is corrupted. Bits per value should be no more than 64 and is %d.", blockIndex, bitsPerValue), input);
        }
        currentFoRValues = DirectReader.getInstance(seekingInput, bitsPerValue, currentPosition);
    }
}

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Rebuild the affected SAI index (rebuild_index or DROP/CREATE INDEX).
  2. Check disk/filesystem health and validate component checksums.
  3. Upgrade Cassandra if this appears after an unclean shutdown, as newer versions harden block validation.
Defensive patterns

Strategy: try-catch

Try / catch

try { postings.next(); } catch (CorruptIndexException e) { log.error("SAI postings block corrupt", e); scheduleIndexRebuild(index); }

Prevention

When it happens

Trigger: ReBuffering a postings block whose stored bitsPerValue byte is > 64 — reading misaligned or corrupt block data (e.g. a wrong pointer landed mid-block).

Common situations: Disk corruption, truncated/overwritten SAI postings files, or reading a postings block with a stale offset after a partial write during a crash.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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