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

Jon Meredith updated CASSANDRA-20561:
-------------------------------------
          Fix Version/s: 4.0.18
                         4.1.9
                         5.0.5
                         6.x
                             (was: 5.x)
                             (was: 4.0.x)
                             (was: 4.1.x)
                             (was: 5.0.x)
          Since Version: 2.2.19
    Source Control Link: 
https://github.com/apache/cassandra/commit/d4d858d3822c85e6b4b71b1004d8ba6c63fa5134
             Resolution: Fixed
                 Status: Resolved  (was: Ready to Commit)

Affects earlier versions, but I didn't go back beyond 2.2

> Updating a column with a new TTL but same expiration time is 
> non-deterministic and causes repair mismatches.
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-20561
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20561
>             Project: Apache Cassandra
>          Issue Type: Bug
>          Components: Local/Compaction
>            Reporter: Jon Meredith
>            Assignee: Jon Meredith
>            Priority: Normal
>             Fix For: 4.0.18, 4.1.9, 5.0.5, 6.x
>
>         Attachments: ci_summary_4.0.html, ci_summary_4.1.html, 
> ci_summary_5.0.html, ci_summary_trunk.html
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> If columns written with TTLs are rewritten with a different TTL but the same 
> expiration time, merging them is non-deterministic leading to preview repair 
> mismatches and inability to repair them.
> One way this can happen is if data with TTLs was migrated from a source table 
> to a new table by retrieving the original write time and TTL
> {code}
> SELECT TTL(col), WRITETIME(col) from src
> {code}
> And then inserted into a new table with
> {code}
> INSERT INTO dst(col) VALUES (?) USING TTL ? AND TIMESTAMP ?
> {code}
> Expiry time is calculated by adding the current time (not the supplied 
> timestamp) to the returned {{TTL()}} value which will give the same expired 
> time assuming the INSERT completes in the same second.
> TTL is not currently considered when reconciling partitions/cell liveness 
> when the local deletion times and values are equal and is determined by the 
> order cells are input to reconciliation. Different merge orders mean replicas 
> have different TTL values which are detected and reported as preview repair 
> mismatches.
> The fix is to make resolving partition LivenessInfo and regular cell 
> resolution deterministically handle the case there the expiration timestamps 
> match but the TTLs are different. Select the lower TTLd value will pick the 
> most recent write which probably matches user intent for the migration case 
> and persist that value in the ttl field serialized to the sstable.



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

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

Reply via email to