cassandra中的ttl创建墓碑

ttl in cassandra creating tombstones

我只对 cassandra 做插入操作。在插入时,仅插入非空值以避免墓碑。但是很少有记录是用 TTL 插入的。但是然后从 table 执行 select count(*) 会出现以下错误 -

Read 76 live rows and 1324 tombstone cells for query SELECT * FROM xx.yy WHERE token(y) >= token(fc872571-1253-45a1-ada3-d6f5a96668e8) LIMIT 100 (see tombstone_warn_threshold)

Cassandra 3.7 中的 TTL 插入会导致逻辑删除吗?如何减轻警告?

没有更新,只有插入,一些记录没有 TTL,其他有 TTL

来自 datastax 文档:https://docs.datastax.com/en/cql/3.1/cql/cql_using/use_expire_c.html

After the number of seconds since the column's creation exceeds the TTL value, TTL data is considered expired and is included in results. Expired data is marked with a tombstone after on the next read on the read path, but it remains for a maximum of gc_grace_seconds. After this amount of time, the tombstoned data is automatically removed during the normal compaction and repair processes.

在压缩或修复之前,这些条目将被视为墓碑。

为TTL和压实加一分。即使在 gc_grace_seconds 之后,压缩的默认设置仅根据 tombstone_compaction_intervaltombstone_threshold

开始

之前,我们遇到了读取超时问题,这是由于具有大量记录的表的大量逻辑删除。最终,我们需要减少 tombstone_threshold 并启用 unchecked_tombstone_compaction 以使压缩过程更频繁地触发。

您可以参考以下文档了解更多详情

http://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlCreateTable.html?hl=unchecked_tombstone_compaction#tabProp__cqlTableGc_grace_seconds