[
https://issues.apache.org/jira/browse/CASSANDRA-2620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030745#comment-13030745
]
Sylvain Lebresne commented on CASSANDRA-2620:
---------------------------------------------
We kind of "could", but that would be 'column.localExpirationTime -
column.timestamp' which involves mixing server time with client time because we
don't have the server 'insertion time'. While the current solution strongly
suggest using time-based timestamps (so that you can compute how long you
column still have to live), it does not particularly impose that the client and
server clocks be synchronized. Even without considering the worst situation,
I'm pretty sure if we do that we'll have a few of the returned TTL that differs
from what we were returning previously (if only by 1 second). Is that a big
deal ? I don't know. But I did already wrote myself stuff like {{if c.ttl == 42
then ...}} (where I did mean the original TTL, because I had data inserted with
different category of TTL and I knew one of those was 42).
Basically, if you don't keep the original TTL, you won't be able to recompute
it precisely (you can and will sometimes be off by a second or two). It makes
it less convenient to categorize data by what was the lifetime they were
assigned. Now I know it's easy to discard this as "who would want to do that
?!", but well I've done it.
To sum that up:
# I don't really adhere to the idea that the current situation is a bug that
it would be stupid to keep around. However I do agree that the alternative of
not persisting the TTL has probably more advantages. But,
# I don't think we can change this without introducing some form of
incompatibility. Will that be cause problems to someone ? I don't know and if
someone knows, he's smarter than me. Hence my reluctance to do this.
> Don't persist TTL for expiring columns
> --------------------------------------
>
> Key: CASSANDRA-2620
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2620
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: Stu Hood
> Priority: Minor
> Fix For: 1.0
>
>
> We persist both the TTL (5 seconds from now) and the localExpirationTime (the
> local time at +5 seconds) for expiring columns, but the TTL is never used
> again, except when we return expiring columns to clients.
> Rather than storing the TTL to return to clients, we could calculate a delta
> TTL value by subtracting the current time from the localExpirationTime, and
> save 4 bytes on disk.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira