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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to