cassandratombstone

Cassandra is tracking the number of deletion in sstables to trigger a compaction?


Wonder whether Cassandra is triggering a compaction (STCS or LCS) based on the number of deletion in sstables? In LCS, as I know, cassandra compacts sstables to next level only if a level is full. But the size of a deletion recored is usually small. If just consider the sstable size to decide whether a level is full or not, it may take long for a tombstone to be reclaimed.

I know rocksdb is triggering compaction using the number of deletions in sstables. This will help to reduce tombstone.


Solution

  • Yes, Cassandra's compaction can be triggered by the number of deletion (a.k.a. tombstones)

    Have a look to the common options for all the compaction strategies and specifically this param:

    tombstone_threshold

    How much of the sstable should be tombstones for us to consider doing a single sstable compaction of that sstable.

    See doc here: https://cassandra.apache.org/doc/latest/cassandra/operating/compaction/index.html