首页 文章

Cassandra选择ttl()的TTL值不正确

提问于
浏览
0

I have a 3 node cluster with replication factor : 2.

考虑的列族有 default_time_to_live = 3600 哪个是使用alter table设置的: cqlsh:summary> alter table match with default_time_to_live=3600;

将数据插入columnfamily并立即查询后,选择ttl(column_name),我得到的结果不正确 .

cqlsh:summary> select ttl(end_time) from match limit 5;

ttl(end_time)

3132
      5342
      5342
      1802
      1802

(5排)

Keyspace定义:

CREATE KEYSPACE summary WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': '2'}  AND durable_writes = true;

列族定义:

CREATE TABLE summary.match (
match_name text,
start_time bigint,
end_time bigint,
PRIMARY KEY (match_name, start_time)) WITH CLUSTERING ORDER BY (start_time ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
AND comment = ''
AND compaction = {'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32'}
AND compression = {'sstable_compression':'org.apache.cassandra.io.compress.LZ4Compressor'}
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 3600
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 = '99.0PERCENTILE';

使用:Cassandra 2.1.0 | CQL规范3.2.0

它不应该低于3600吗? 5342 的TTL值在哪里?

问题: default_time_to_live 值如何生效?

1 回答

相关问题