Search code examples
cassandracassandra-2.0cassandra-cli

What is the graveyard compaction in cassandra?


Cassandra noob here. While going through the documentation etc, I'm repetitevely finding references to graveyard compaction (and occasionally tombstones), example:

$ cassandra-cli 
[default@unknown] help truncate;
...
A snapshot of the data is created, which is deleted asyncronously during a
'graveyard' compaction.

I've tried googling around, but that just turns up more places where graveyard compaction is referred, examples this, this and this.

What exactly is the graveyard compaction? And what do people mean when they refer to tombstones?


Solution

  • A Graveyard compaction is a compaction that deletes SSTables that are no longer needed.

    For instance during a drop, after the snapshot is made, the sstables of the respective table are deleted by a graveyard compaction.

    A snapshot of the data is created, which is deleted asyncronously during a
    'graveyard' compaction.
    

    What you found here is just an error in the documentation. It should say:

    A snapshot of the data is created, 
    then the data is deleted asyncronously during a 'graveyard' compaction.