很多人很難理解Cassandra的tombstone和gc_grace_seconds設(shè)計(jì)彻舰,不清楚已經(jīng)刪除的數(shù)據(jù)為什么會(huì)復(fù)活。我看到一個(gè)很好的例子诫咱,Cassandra當(dāng)前的社區(qū)負(fù)責(zé)人Jeff Jirsa貢獻(xiàn)的笙隙。文字很簡(jiǎn)單就不翻譯了。
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.