cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-9420) Table option for promising that you will never touch a column twice
Date Wed, 20 May 2015 12:55:02 GMT

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

Sylvain Lebresne commented on CASSANDRA-9420:
---------------------------------------------

bq. What we should have done back then was to make that option not a default, but an enforced
constrain. So that every update/insert always comes with the same TTL

The problem Björn wants to improve is explicitly the case where there is "lots of variations
in TTLs", so such option won't really help. And as he said, when all TTLs are the same, DTCS
is able to drop expired sstable very efficiently so that this kind of option is not really
needed for that case either.

bq. Even if gc gs is 0, we must ensure that there is no intersection with other sstables,
before purging it.

Yes, but as the description mentions time series and DTCS, so I assumed the "min timestamp"
checks would solve this. But I was wrong. As Björn says, with variable TTLs, the "min timestamp"
check will rarely help.  

That said, there is probably  better heuristics to improve this case.  For instance, in theory,
we could use the the sstable max/min clustering values which, for time series with DTCS, would
allow to decide that most cells can't intersect any non-compacted sstable (one question being
how efficient we can make that check be).

Because Cassandra cannot guarantee you won't override a column, so adding an option that tells
it to assume it blindly feels pretty dangerous and I'm personally really not a fan.

> Table option for promising that you will never touch a column twice
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-9420
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9420
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Björn Hegerfors
>
> There are time series use cases where you write all values with various TTLs, have GC
grace = 0 and never ever update or delete a column after insertion. In the case where all
TTLs are the same, DTCS with recent patches works great. But when there is lots of variations
in TTLs, you are forced to choose between splitting your table into multiple TTL tiers or
having your SSTables filled to the majority with tombstones. Or running frequent major compactions.
> The problem stems from the fact that Cassandra plays safe when a TTL has expired, and
turns it into a tombstone, rather than getting rid of it on the spot. The reason is that this
TTL _may_ have been in a column which has had an earlier write without (or with a higher)
TTL. And then that one should now be deleted too.
> I propose that there should be table level setting to say "I guarantee that there will
never be any updates to any columns". The effect of enabling that option is that all tombstones
and expired TTLs should always be immediately removed during compaction. And the check for
dropping entirely expired SSTables can be very loosened for these tables.
> This option should probably require gc_grace_seconds to be set to zero. It's also questionable
if writes without TTL should be allowed to such a table, since those would become constants.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message