Hemalatha
Hemalatha

Reputation: 95

DateTieredCompactionStrategy sub-properties in Cassandra

Have some questions on DateTieredCompactionStrategy sub-properties in Cassandra

  1. The blog http://www.datastax.com/dev/blog/datetieredcompactionstrategy, says: Base_time_seconds: “This is the size of the first window, defaults to 3600 seconds (1 hour). The rest of the windows will be min_threshold (default 4) times the size of the previous window.” With default value of 3600 i.e., 1hr for base_time_seconds does it mean first compaction triggers at 1st hour, next at 4,16, 64 hours and so on?

  2. max_window_size_seconds: Default 1 day. Does it mean my compaction is run atleast once in a day?

  3. tombstone_compaction_interval: Default 10 days. If my sstable is say 7 day old, but is full of expired data due to ttl 1 day and GC_grace_sec of 1 day. Does it mean that still my sstables are not removed?

Does tombstone_compaction_interval take priority over ttl and GC_grace_sec

  1. min_threshold: When compaction is run, and no, of sstables is < min_threshold, then my compaction is not run?

Upvotes: 1

Views: 395

Answers (1)

Marcus Eriksson
Marcus Eriksson

Reputation: 118

  1. No - DTCS finds the sstables within one of those windows (1h, 4h, ..) and if it thinks it needs to compact them together (iirc for the first window it has to be more than min_threshold, for the rest 2 or more), it will.
  2. No. The number of compactions is only depending on the number of flushed/streamed sstables. max window size is just to make sure we don't get huge older windows which hurt when bootstrapping/streaming etc.
  3. No, with DTCS you should not touch the tombstone_compaction_interval - the whole idea is that once the whole sstable is expired, the entire thing will get dropped automatically without compaction.
  4. Correct, but it is per window, so you could have 100 sstables in separate windows with DTCS

Note that DTCS is deprecated and you should really be using TWCS instead. If you use cassandra < 3.0, you can just build the jar file and drop it in the lib directory to use it. https://github.com/jeffjirsa/twcs https://issues.apache.org/jira/browse/CASSANDRA-9666

Upvotes: 2

Related Questions