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

Sam Tunnicliffe updated CASSANDRA-13525:
----------------------------------------
    Reproduced In: 3.10, 3.0.13  (was: 3.0.13, 3.10)
           Status: Patch Available  (was: Open)


The problem occurs when a row spans an block in the row index. When deciding 
whether to continue reading from disk or move to the next index block, 
{{UnfilteredDeserializer.OldFormatDeserializer}} accounts for the fact that 
{{hasNext()}} has bumped the file pointer past the end of the last consumed 
{{Unfiltered}}. But, it doesn't account for reading the legacy atoms from disk 
to feed the unfiltered iterator. The legacy atom iterator actually reads the 
first atom of the {{Unfiltered}} *after* the next one, so that needs to be 
included when calculating the {{lastConsumedPosition}}, which in turn 
determines whether the current index block has been exhausted. This only 
affects the reverse iterator as it's mitigation for rows which cross index 
block boundaries is more complex than the forward iterator. 

For 3.0, I've pushed [a 
branch|https://github.com/beobal/cassandra/tree/13525-3.0] with a fix and unit 
test. Also, it adds a unit test for CASSANDRA-13236 (there's a [dtest 
PR|https://github.com/riptano/cassandra-dtest/pull/1469] open already), this 
issue was discovered during investigation into that one but I struggled to 
figure out a decent unit test for it at the time. 

The 3.11 branch should be pretty much identical, but merging 3.0 -> 3.11 is 
broken at the moment, (looks like 
[263740daa4|https://github.com/apache/cassandra/commit/263740daa4c8162a157aa6fbb97793f158d142d1]
 needs to be merged with {{-s ours}}, but I'll double check). When that's fixed 
I'll push a 3.11 branch.


> ReverseIndexedReader may drop rows during 2.1 to 3.0 upgrade
> ------------------------------------------------------------
>
>                 Key: CASSANDRA-13525
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13525
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local Write-Read Paths
>            Reporter: Sam Tunnicliffe
>            Assignee: Sam Tunnicliffe
>
> During an upgrade from 2.1 (or 2.2) to 3.0 (or 3.x) queries which perform 
> reverse iteration may silently drop rows from their results. This can happen 
> before sstableupgrade is run and when the sstables are indexed.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to