When I remove rows in Cassandra I delete only columns not row keys

只谈情不闲聊 提交于 2019-12-06 20:06:08

问题


If I delete every keys in a ColumnFamily in a Cassandra db using remove(key), then if I use get_range_slices, rows are still there but without columns. How could I remove entire rows?


回答1:


Just been having the same issue and I found that:

This has been fixed in 0.7 (https://issues.apache.org/jira/browse/CASSANDRA-1027). And backported to 0.6.3

This is also relevant: https://issues.apache.org/jira/browse/CASSANDRA-494




回答2:


Why do deleted keys show up during range scans?

Because get_range_slice says, "apply this predicate to the range of rows given," meaning, if the predicate result is empty, we have to include an empty result for that row key. It is perfectly valid to perform such a query returning empty column lists for some or all keys, even if no deletions have been performed.




回答3:


Cassandra uses Distributed Deletes as expected.

Thus, a delete operation can't just wipe out all traces of the data being removed immediately: if we did, and a replica did not receive the delete operation, when it becomes available again it will treat the replicas that did receive the delete as having missed a write update, and repair them! So, instead of wiping out data on delete, Cassandra replaces it with a special value called a tombstone. The tombstone can then be propagated to replicas that missed the initial remove request.

http://wiki.apache.org/cassandra/DistributedDeletes




回答4:


I tested with cassandra 0.63 and the problem is still the same. I don't think that bug fix is for getting rid of the deleted row ids. See

http://wiki.apache.org/cassandra/FAQ#range_ghosts

for more information.



来源:https://stackoverflow.com/questions/2981483/when-i-remove-rows-in-cassandra-i-delete-only-columns-not-row-keys

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!