Is there a way for Cassandra to safely remove the tombstones * before gc_grace_seconds has passed?

I know that early removal of tombstones is dangerous because it can lead to the resurrection of deleted data, but if all replicas have confirmed the deletion, then this deletion should be safe. For example, if the table has a replication coefficient of 3 and all 3 nodes containing the key confirm that they have the corresponding tombstone, it should be safe to perform a compaction in which the tombstones are removed because there would be no long copies of the data.

Is such a safe removal of tombstones possible in Kassandra?

I would rather set gc_grace_seconds to infinity and rely on this type of safe compaction of tombstones than worry about the timing of nodetool repair and gc_grace_seconds .

+7
garbage-collection cassandra tombstone
source share
1 answer

No, it is not possible to remove tombstones without changing gc_grace_seconds.

There are operations in which all 3 replicas can cause a tombstone, delete it, and then need it later. Consider the case where you need to transfer the previous SSTable back to the cluster.

This type of manual removal of tombstones will be much worse if you do it periodically, and not constantly. You will unnecessarily read unnecessary data, as well as constantly compact the tombstones that should be removed.

My recommendation is to set gc_grace_seconds to something reasonable (10 days in order) and schedule a repair using opscenter or cassandra-reaper.

+2
source share

All Articles