You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Arjun Ashok (Jira)" <ji...@apache.org> on 2026/05/08 23:51:00 UTC

[jira] [Created] (CASSANDRA-21358) CursorBasedCompaction: Final index block width off by one byte in SSTableCursorWriter#appendBIGIndex()

Arjun Ashok created CASSANDRA-21358:
---------------------------------------

             Summary: CursorBasedCompaction: Final index block width off by one byte in SSTableCursorWriter#appendBIGIndex()
                 Key: CASSANDRA-21358
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21358
             Project: Apache Cassandra
          Issue Type: Bug
          Components: Local/SSTable
            Reporter: Arjun Ashok


The cursor compaction path computes the width of the final index block as (partitionEnd - partitionStart - 1) - indexBlockStartOffset, which excludes the end-of-partition marker byte. 

The iterator path (BigFormatPartitionWriter#finish()) calls addIndexBlock() after writing the end marker, so its width includes that byte. 

The resulting Index.db entry has a width 1 byte smaller than the iterator produces. When seeking into a large partition near the end using the index, the reader's internal byte accounting is off by 1, causing misaligned reads. Affects any partition large enough to span multiple index blocks (default threshold: 64 KiB).




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org