I have few questions about Cassandra tombstones and manual compaction.
Let's say that I delete a row (partition key) in my Cassandra cluster at time X. Let's assume that gc_grace_seconds
has its default value (ten days).
Is it true that if manually start a
nodetool compact
at a time lower than X+10 days the old data will be still on disk after the compaction ?Instead, if I start
nodetool compact
at a time higher than X+10 days the old data is really removed from disk ?Let's assume that the delete was issued at time X and later on I change the
gc_grace_seconds
to a lower value (let's say 1 day). If at time X+2 days I startnodetool compact
the old data will be really removed from disk ? In other words the tombstone, when created, contains the deletion time and not the expiration time, right ?
Yes tombstones are not removed if compaction is run before gc_grace_seconds.
Generally yes but depends on compaction strategy also. So you cannot be 100% sure of this.
Yes you are correct on this. Tombstones contains deletion time. Expiry depends on gc_grace_seconds value of the table.
You should generally not run nodetool compact command (major compcations) and your compactions should be running automatically (minor compactions).