You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "David Capwell (Jira)" <ji...@apache.org> on 2020/07/30 02:03:00 UTC

[jira] [Commented] (CASSANDRA-15959) org.apache.cassandra.cql3.validation.operations.TTLTest testCapWarnExpirationOverflowPolicy

    [ https://issues.apache.org/jira/browse/CASSANDRA-15959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17167593#comment-17167593 ] 

David Capwell commented on CASSANDRA-15959:
-------------------------------------------

Thanks for the patch.

I am +1, but rather than calling computeMaxTTL in the loop can we do it right after the query?  Once we have the result set back all values are fixed, so safe to compute only once (current time is assumed to be later than query time; if clocks shift then this will still fail).

Had to look at TTL logic but this is what I saw
* local delete is capped to 68 years after epoch (as of this moment we are ~50 years after epoch, so 18 years left before purge)
* local delete is set at write time
* ttl(column) is "how much time is left" (local_delete_time - now_in_seconds)
** defined by this function org.apache.cassandra.cql3.selection.ResultSetBuilder#remainingTTL
** the frontend logic is here org.apache.cassandra.cql3.selection.WritetimeOrTTLSelector#addInput, but that just pulls w/e was put into the RS

Given this, before the query our minMax is larger than after the query (since now grows larger (assuming no clock rollback)), so ttl >= minMaxTTL would be smaller >= larger and fail.

> org.apache.cassandra.cql3.validation.operations.TTLTest testCapWarnExpirationOverflowPolicy
> -------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-15959
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15959
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/unit
>            Reporter: David Capwell
>            Assignee: Brandon Williams
>            Priority: Normal
>             Fix For: 4.0-beta
>
>         Attachments: 0001-computeMaxTTL-directly-before-fetching-TTL.patch
>
>
> Build: https://ci-cassandra.apache.org/job/Cassandra-trunk-test/194/testReport/junit/org.apache.cassandra.cql3.validation.operations/TTLTest/testCapWarnExpirationOverflowPolicy/
> junit.framework.AssertionFailedError
> 	at org.apache.cassandra.cql3.validation.operations.TTLTest.checkTTLIsCapped(TTLTest.java:321)
> 	at org.apache.cassandra.cql3.validation.operations.TTLTest.verifyData(TTLTest.java:303)
> 	at org.apache.cassandra.cql3.validation.operations.TTLTest.testCapExpirationDateOverflowPolicy(TTLTest.java:248)
> 	at org.apache.cassandra.cql3.validation.operations.TTLTest.testCapExpirationDateOverflowPolicy(TTLTest.java:199)
> 	at org.apache.cassandra.cql3.validation.operations.TTLTest.testCapWarnExpirationOverflowPolicy(TTLTest.java:140)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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