jeffjirsa / twcs

Time Window CompactionStrategy for Apache Cassandra
52 stars 24 forks source link

SSTables created regardless to TWCS window definition #6

Open sternr opened 6 years ago

sternr commented 6 years ago

Our issue is old SSTables are never deleting, and running sstableexpiredblockers tells the issue is because practically ALL our SSTables have overlapping timestamps preventing it from tombstoning.

We're running Cassandra 2.1.14, and our table is configured as follows:

CREATE TABLE KS.CF (
    KEY text,
    timestamp timeuuid,
    DATA blob,
    PRIMARY KEY (KEY, timestamp)
) WITH CLUSTERING ORDER BY (timestamp DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = '{"keys":"ALL", "rows_per_partition":"300"}'
    AND comment = ''
    AND compaction = {'compaction_window_unit': 'DAYS', 'compaction_window_size': '7', 'class': 'com.jeffjirsa.cassandra.db.compaction.TimeWindowCompactionStrategy'}
    AND compression = {'chunk_length_kb': '4', 'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 1814400
    AND gc_grace_seconds = 3600
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99.0PERCENTILE';

And our SSTables look as such:

image

Why do we not have 1 SSTable per week (as configured by TWCS)? and how come we've so much overlapping?

Thanks!!