cannot delete row key

2019-07-07 06:16发布

问题:

I'm having an issue while deleting row key in Cassandra. Whenever I delete Row Key all the columns contained by that RowKey are deleted but RowKey itself is not deleted. Can anybody tell me how to remove a rowkey, once it is inserted in columnfamily.

I'm looking forward to do that via thrift client.

回答1:

This is a side effect of how distributed deletes work in Cassandra. From the Cassandra wiki page on distributed deletes:

[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.

Also take a look at this question on the FAQ: Why do deleted keys show up during range scans?