Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra "default_time_to_live" property is not deleting data

I've created a table like:

CREATE TABLE IF NOT EXISTS metrics_second(
  timestamp timestamp,
  value counter,
  PRIMARY KEY ((timestamp))
) WITH default_time_to_live=1;

And inserted some data like:

UPDATE metrics_second SET value = value + 1 WHERE timestamp = '2015-01-22 17:43:55-0800';

When executing SELECT * FROM metrics_second I always see the data, even after a minute or so, although the default_time_to_live property of the table is set to one second. Why is that?

like image 276
Mark Avatar asked Jan 24 '15 00:01

Mark


1 Answers

As @RussS confirmed, unfortunately Cassandra doesn't support TTL on tables or rows when there are counters.

Even if default_time_to_live is being set when creating the table and no error is being returned, Cassandra won't enforce the TTL.

like image 112
Mark Avatar answered Sep 30 '22 05:09

Mark