Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-14944

Tombstones are not removed if bloom filter is turned off

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • Local/Compaction
    • None
    • Normal

    Description

      Well actually they are deleted, but not always even though they should, because check is done using Index of overlapped tables

      When purge evaluator is constructed we are checking overlapping tables using bloom filter, but when it is disabled we are checking against index, but if condition is not properly constructed and we still check bloom filter which is AlwaysPresentFilter and every overlapping sstable is used to get minTimestamp and tombstones, that have their timestamp >= minTimestamp won't be deleted

      if (sstable.getBloomFilter() instanceof AlwaysPresentFilter && sstable.getPosition(key, SSTableReader.Operator.EQ, false) != null
          || sstable.getBloomFilter().isPresent(key))
      {
      

      Should be something like this

      boolean mightBePresentInTable = sstable.getBloomFilter() instanceof AlwaysPresentFilter ? sstable.getPosition(key, SSTableReader.Operator.EQ, false) != null : sstable.getBloomFilter().isPresent(key)
      

      Code pointers in 3.11 https://github.com/apache/cassandra/blob/08363afa5354c00a7ecd62fe273c392a678db28a/src/java/org/apache/cassandra/db/compaction/CompactionController.java#L274 and 4.0 https://github.com/apache/cassandra/blob/11384c3279a66e6c0fb7861e2b188b25e963580f/src/java/org/apache/cassandra/db/compaction/CompactionController.java#L281

      Attachments

        Activity

          People

            Unassigned Unassigned
            betalb Vitalii Ishchenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: