How default_time_to_live would delete rows without tombstones in Cassandra?

前端 未结 2 697
忘掉有多难
忘掉有多难 2021-01-12 15:19

From How is data deleted?

Cassandra allows you to set a default_time_to_live property for an entire table. Columns and rows marked with regular TTLs a

2条回答
  •  抹茶落季
    2021-01-12 15:34

    AFAIK there is no big difference between tombstone records and the ones with expired TTLs. In your case, forcing major compaction transformed TTL expired record to the tombstone, but it was not purged due to gc_grace_seconds. According to this presentation, tombstones/ttl-expired-records go away:

    • Never before it's gc_grace_seconds old
    • During compaction, for a tombstone/ttl being past gc_grace, it's partition key is checked against the bloom filters of all other SSTables for the given table
    • If there's a bloom filter collision, the tombstone will remain, even if collision was false positive.
    • If there is any data, even other tombstones for that partition in any SSTable, the tombstone will not get cleaned up
    • If bloom filters indicate that there is no chance of overlap on that partition key, then the tombstone gets cleaned up.

    So technically, the tombstone/ttl may go away after gc_grace, but it's not guaranteed.

提交回复
热议问题