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

Robert Tarrall commented on CASSANDRA-14496:
--------------------------------------------

I definitely agree with respect to "don't enable by default."

However, I believe if I have set {{unchecked_tombstone_compaction}} to true, 
I'm asking for these compactions.  I may however be missing something – is 
there another purpose for that option?  I.e. might someone else be setting that 
to true who would be surprised to find it enables tombstone compactions?  I 
can't find any documentation which explains that 
{{'unchecked_tombstone_compaction': 'true'}} has no effect unless you also 
explicitly set other options, and I see discussions in blog posts that suggest 
people think that setting is how you enable tombstone compactions in TWCS, and 
I had to rummage around in source code for a while to work out why I wasn't 
getting those compactions.

Coming at this from the other direction may help.  If I have the following 
compaction defined:
{code:java}
'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy', 
'compaction_window_size': '1', 'compaction_window_unit': 'HOURS', 
'unchecked_tombstone_compaction': 'true'{code}
... I don't get tombstone compactions.  When I change that to:
{code:java}
'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy', 
'compaction_window_size': '1', 'compaction_window_unit': 'HOURS', 
'tombstone_compaction_interval': '86400', 'unchecked_tombstone_compaction': 
'true'
{code}
... I have just switched from "no tombstone compactions" to "tombstone 
compactions".  This seems like a surprising side effect – one would not expect 
that explicitly setting an option to its default value would change behavior 
like this.

If there's another purpose for unchecked_tombstone_compaction, I'd recommend 
the defaults for TWCS make it clear that tombstone compactions intentionally 
act differently from STCS; instead of interval & threshold defaults of 86400 & 
0.2, they should be infinitely high, and documented as such, so that you must 
specify non-default values in order to get tombstone compactions.

> TWCS erroneously disabling tombstone compactions
> ------------------------------------------------
>
>                 Key: CASSANDRA-14496
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14496
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Compaction
>            Reporter: Robert Tarrall
>            Priority: Minor
>
> This code:
> {code:java}
> this.options = new TimeWindowCompactionStrategyOptions(options);
> if 
> (!options.containsKey(AbstractCompactionStrategy.TOMBSTONE_COMPACTION_INTERVAL_OPTION)
>  && 
> !options.containsKey(AbstractCompactionStrategy.TOMBSTONE_THRESHOLD_OPTION))
> {
> disableTombstoneCompactions = true;
> logger.debug("Disabling tombstone compactions for TWCS");
> }
> else
> logger.debug("Enabling tombstone compactions for TWCS");
> }
> {code}
> ... in TimeWindowCompactionStrategy.java disables tombstone compactions in 
> TWCS if you have not *explicitly* set either tombstone_compaction_interval or 
> tombstone_threshold.  Adding 'tombstone_compaction_interval': '86400' to the 
> compaction stanza in a table definition has the (to me unexpected) side 
> effect of enabling tombstone compactions. 
> This is surprising and does not appear to be mentioned in the docs.
> I would suggest that tombstone compactions should be run unless these options 
> are both set to 0.
> If the concern is that (as with DTCS in CASSANDRA-9234) we don't want to 
> waste time on tombstone compactions when we expect the tables to eventually 
> be expired away, perhaps we should also check unchecked_tombstone_compaction 
> and still enable tombstone compactions if that's set to true.
> May also make sense to set defaults for interval & threshold to 0 & disable 
> if they're nonzero so that setting non-default values, rather than setting 
> ANY value, is what determines whether tombstone compactions are enabled?



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