我们有ttl
24 小时或 1 天的下表。我们有 4 个cassandra 3.0 node cluster
,将spark
在此表上进行处理。一旦处理完毕,它将截断表中的所有数据,并插入新的一批数据。这将是一个持续的过程。
我看到的问题是,我们越来越多,因为数据在完成处理tombstones
后每天都被频繁截断。spark
如果我设置gc_grace_seconds
为默认,会有更多tombstones
。如果我减少gc_grace_seconds
到 1 天会有问题吗?即使我每天对那张桌子进行维修也足够了。
我应该如何解决这个问题,我知道频繁删除是一种反模式Cassandra
,还有其他方法可以解决这个问题吗?
TABLE b.stag (
xxxid bigint PRIMARY KEY,
xxxx smallint,
xx smallint,
xxr int,
xxx text,
xxx smallint,
exxxxx smallint,
xxxxxx tinyint,
xxxx text,
xxxx int,
xxxx text,
xxxxx text,
xxxxx timestamp
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCom pactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandr a.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 86400
AND gc_grace_seconds = 864000
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 = '99PERCENTILE';
谢谢你