Datageek
Datageek

Reputation: 26679

Cassandra - deleted data still there

Cassandra version: 1.2.6. Single node.

I've deleted the data from table

DELETE FROM mytable WHERE symbol = 'symbol1' AND field = 'field1';

and the following query does not return it:

SELECT symbol, ts, value FROM mytable WHERE symbol IN ('symbol1');

However, some different, more restrictive queries still return the old (deleted) data:

SELECT symbol, ts, value FROM mytable WHERE symbol IN ('symbol1') AND field='field1' AND ts >= '2013-09-04 00:00:00+0000' AND ts <= '2014-09-25 00:00:00+0000';

The data didn't reappear instantly but only after around 5-10 minutes, after few additional rows were added to the table for that symbol/field.

I've run: nodetool repair mykeyspace

But it didn't help. Any ideas how to fix it?

Schema of my table:

CREATE TABLE mytable (
  symbol text,
  field text,
  ts timestamp,
  value double,
  PRIMARY KEY (symbol, field, ts)
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};

Upvotes: 2

Views: 1970

Answers (2)

catpaws
catpaws

Reputation: 2283

This problem, fixed in 1.2.19 along with a couple of other tombstone issues, sounds like the one you're having: https://issues.apache.org/jira/browse/CASSANDRA-7810

If you're willing to experiment, would you consider upgrading? There are quite a few changes/fixes for Cassandra 1.2.x related to deleted data: https://github.com/apache/cassandra/blob/cassandra-1.2/CHANGES.txt

Upvotes: 5

Chiron
Chiron

Reputation: 20245

Deleting in Cassandra is radically different from, say RDBMS. I highly recommend reading Datastax Documentation : About Deletes.

Upvotes: 1

Related Questions