[ 
https://issues.apache.org/jira/browse/CASSANDRA-14823?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Blake Eggleston updated CASSANDRA-14823:
----------------------------------------
    Reviewer: Sam Tunnicliffe
      Status: Patch Available  (was: Open)

[3.0 fix|https://github.com/bdeggleston/cassandra/tree/14823-3.0]
[2.1 sstable generator|https://github.com/bdeggleston/cassandra/tree/14823-2.1]
[circle|https://circleci.com/gh/bdeggleston/workflows/cassandra/tree/cci%2F14823-3.0]

This fixes a few bugs related to range tombstones and iterating over legacy 
sstables in reverse.

First, in 2.1, range tombstones spanning multiple indexed blocks are rewritten 
at the beginning of each block they partially cover. 3.0 expects open markers 
to be noted in the column index, so it treats these as normal range tombstones, 
which will lead to duplicate start bounds being emitted, and incorrect dropping 
of rows in some cases. When generated by memtable flush, the repeated range 
tombstone open marker is less than the current index block first name. When 
generated by compaction, the index block first name is set to the repeated 
tombstone's open bound, which is less than the preceding index block's last 
name. Fixing this complicates the logic of determining if the contents of a row 
span multiple index blocks and correctly handling them, so that's been modified 
here as well.

Next, since the open and closing bound of a range tombstone are stored together 
on disk, we stash the closing bound in memory to read out later. However we use 
the file pointer to figure out when we should stop reading an index block. So 
any rt closing bound that should be the last thing we emit for an index block 
gets dropped, leading to an open ended closing bound being emitted. That's 
fixed here as well.

> Legacy sstables with range tombstones spanning multiple index blocks create 
> invalid bound sequences on 3.0+
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-14823
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14823
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Blake Eggleston
>            Assignee: Blake Eggleston
>            Priority: Major
>             Fix For: 3.0.x, 3.11.x
>
>
> During upgrade from 2.1 to 3.0, reading old sstables in reverse order would 
> generate invalid sequences of range tombstone bounds if their range 
> tombstones spanned multiple column index blocks. The read fails in different 
> ways depending on whether the 2.1 tables were produced by a flush or a 
> compaction.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to