Cassandra删除数据复活问题

很多人很难理解Cassandra的tombstone和gc_grace_seconds设计,不清楚已经删除的数据为什么会复活。我看到一个很好的例子,Cassandra当前的社区负责人Jeff Jirsa贡献的。文字很简单就不翻译了。

The TTL'd cell is treated as a tombstone. gc_grace_seconds applies to TTL'd cells, because even though the data is TTL'd, it may have been written on top of another live cell that wasn't ttl'd:

Imagine a test table, simple key->value (k, v).

INSERT INTO table(k,v) values(1,1);

Kill 1 of the 3 nodes

UPDATE table USING TTL 60 SET v=1 WHERE k=1 ;

60 seconds later, the live nodes will see that data as deleted, but when that dead node comes back to life, it needs to learn of the deletion.

你可能感兴趣的:(Cassandra删除数据复活问题)