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

Sam Tunnicliffe commented on CASSANDRA-14092:
---------------------------------------------

I think we're almost there with this, I just have a few smallish comments on 
the v5 patches:
 * In the 3.0+ branches, 
{{ExpirationDateOverflowHandling::maybeApplyExpirationDateOverflowPolicy}} can 
use {{Cell.NO_TTL}} rather than 0 in the first check.
 * In 3.0+ you renamed the static policy field to have a shorter name, but 
missed that in the 2.1 & 2.2 branches.
 * In 2.1 I saw some (very) intermittent test failures in TTLTest. I 
instrumented {{checkTTLIsCapped}} to print out the (min | actual | max) TTLs to 
sysout and eventually managed to repro it. You can see from the output that in 
the first line, the min and actual are actually > the max, which caused the 
test to fail (this happened around 10% of the time).

{code:java}
testlist:
 [echo] running test bucket 0 tests
 [junit] WARNING: multiple versions of ant detected in path for junit 
 [junit] 
jar:file:/usr/local/Cellar/ant@1.9/1.9.8/libexec/lib/ant.jar!/org/apache/tools/ant/Project.class
 [junit] and 
jar:file:/Users/sam/git/cassandra/build/lib/jars/ant-1.9.4.jar!/org/apache/tools/ant/Project.class
 [junit] Testsuite: org.apache.cassandra.cql3.validation.operations.TTLTest
 [junit] Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.024 
sec
 [junit] 
 [junit] ------------- Standard Output ---------------
 [junit] WARN 18:01:55 JNA link failure, one or more native method will be 
unavailable.
 [junit] WARN 18:01:55 JNA link failure, one or more native method will be 
unavailable.
 [junit] WARN 18:01:55 Request on table cql_test_keyspace.table_1 with default 
ttl of 630720000 seconds exceeds maximum supported expiration date of 
2038-01-19T03:14:06+00:00 and will have its expiration capped to that date. In 
order to avoid this use a lower TTL or upgrade to a version where this 
limitation is fixed. See CASSANDRA-14092 for more details.
 [junit] WARN 18:01:55 Request on table cql_test_keyspace.table_1 with default 
ttl of 630720000 seconds exceeds maximum supported expiration date of 
2038-01-19T03:14:06+00:00 and will have its expiration capped to that date. In 
order to avoid this use a lower TTL or upgrade to a version where this 
limitation is fixed. See CASSANDRA-14092 for more details.
 [junit] 629629931 | 629629931 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] 629629930 | 629629930 | 629629930
 [junit] ------------- ---------------- ---------------
 [junit] Testcase: 
testCapExpirationDatePolicyDefaultTTL(org.apache.cassandra.cql3.validation.operations.TTLTest):
 FAILED
 [junit] null
 [junit] junit.framework.AssertionFailedError
 [junit] at 
org.apache.cassandra.cql3.validation.operations.TTLTest.checkTTLIsCapped(TTLTest.java:259)
 [junit] at 
org.apache.cassandra.cql3.validation.operations.TTLTest.testCapExpirationDatePolicyDefaultTTL(TTLTest.java:139)
 [junit] 
 [junit]
{code}
The last thing is about providing a route to fix up overflowed dates via scrub, 
I think we should definitely leave the remedial Scrubber code in trunk until we 
have a proper fix committed. This will be in for 4.0, and at that point we can 
hapilly remove it, but until then it feels wrong to not have it. I also think 
we should have the scrub fix in 2.1 & 2.2 as some users have not yet moved to 
3.x and they should probably get the chance to repair (maybe) their data if 
they want/are able to.

 

> Max ttl of 20 years will overflow localDeletionTime
> ---------------------------------------------------
>
>                 Key: CASSANDRA-14092
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14092
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Paulo Motta
>            Assignee: Paulo Motta
>            Priority: Blocker
>             Fix For: 2.1.20, 2.2.12, 3.0.16, 3.11.2
>
>
> CASSANDRA-4771 added a max value of 20 years for ttl to protect against [year 
> 2038 overflow bug|https://en.wikipedia.org/wiki/Year_2038_problem] for 
> {{localDeletionTime}}.
> It turns out that next year the {{localDeletionTime}} will start overflowing 
> with the maximum ttl of 20 years ({{System.currentTimeMillis() + ttl(20 
> years) > Integer.MAX_VALUE}}), so we should remove this limitation.



--
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