Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra Drop Keyspace Snapshot Cleaning

Tags:

cassandra

Was reading in Cassandra Documentation that:

Cassandra takes a snapshot of the keyspace before dropping it. In Cassandra 2.0.4 and earlier, the user was responsible for removing the snapshot manually.

https://docs.datastax.com/en/cql/3.1/cql/cql_reference/drop_keyspace_r.html

This would imply that in versions after Cassandra 2.0.4, this is done automatically. If so, what configuration parameter (if any) sets the time before snapshot is automatically removed when doing a DROP KEYSPACE?

For example, in the case of DROP TABLE, gc_grace_seconds is

the number of seconds after data is marked with a tombstone (deletion marker) before it is eligible for garbage-collection.

like image 988
restj90 Avatar asked Dec 09 '16 14:12

restj90


People also ask

Can I delete snapshot directory?

snapshot directory is a readonly and cannot be deleted , User's will not be able to store anything in snapshot directory they can only copy from it.


1 Answers

I believe this reference is not accurate, Cassandra does not automatically clean up snapshots for you.

Cassandra won’t clean up the snapshots for you

http://cassandra.apache.org/doc/latest/configuration/cassandra_config_file.html#snapshot-before-compaction

You can remove snapshots using the nodetool clearsnapshot command, or manually delete the directories & files yourself (this is safe as snapshots are just file hard-links).

Note also that gc_grace_seconds is not related to snapshots, it is used during compactions only.

like image 75
Justin Cameron Avatar answered Sep 29 '22 18:09

Justin Cameron