How is Cassandra checking if row exists in other SSTables during minor compaction?

44 Views Asked by At

During minor compaction, to reclaim a row tombstone, how cassandra is checking whether the row exists in other sstables? It just checks partition key by bloom filter or checks row key?

For example, there are 3 sstables: s1, s2 and s3. Assume s1 has the row key 'p.c1', where p is partition key and c1 is clustering key. s2 has the row key 'p.c2' and s3 has the tombstone for the row key 'p.c2'. In this case, when minor compaction is triggered on s2 and s3, the row 'p.c2' will be reclaimed after compaction?

Thanks a lot.

1

There are 1 best solutions below

0
Erick Ramirez On

Cassandra combines all the fragments of a partition from the active memtable and SSTables to determine if a tombstone can be dropped from an SSTable(s) being compacted.

Similar to read requests, Cassandra checks the memtable, bloom filter, partition key cache or partition summary, and the partition index to locate the fragments of the data/partition/row on disk.

For reference, have a look at How Cassandra reads data. Cheers!