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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,486评论 0 10
  • 突然想写一个故事,天马行空的故事。 ——你常常有这件事什么时候发生过的感觉,其实是未来的你想起了曾经你干这件事的你...
    林随意阅读 235评论 2 2
  • 2017年11月24日 星期五 学习时间:603天 学习方法:137累积方法 一、今日学习: 1、《易经》谦卦第十...
    静清小舍阅读 198评论 0 0