Hi Lou, My apologies for the delay answering here, and for my misunderstanding in the first place.
we want to keep snapshots that are no older than X days old while purging > the older ones > I think that you can achieve this with some code, out of Cassandra or interacting with Cassandra, using bash, python or whatever you like and works for you :). (a) those created on demand by given name and (b) those create > automatically, for example as a result of a TRUNCATE, that do not have a > well known name. To get rid of the given name ones (a) seems straight > forward. How do I locate and get rid of the automatically created (b) ones? > Snapshots available in 'data/tablename-cfid/snapshots/'. You can get rid of the snapshots (b), and make sure to keep snapshots (a) (if you want to) checking the date of creation of each directory (ie snapshot) in there. Then check the name 'format' maybe with a regex or a using a prefix for 'manual' snapshot (a)? Whatever works well for you again. Finally, run 'nodetool clearsnapshot -t <snapshotname>' (you can also specify the keyspace and table here if needed) What I try to say is that I would probably try to solve this issue outside of Cassandra, only invoking nodetool. Other option, I think you can just remove the old snapshots with 'rm -r /path_to_data/tablename-cfid/snapshots/<snapshotname>'. You can probably do that using something like https://stackoverflow.com/questions/13868821/shell-script-to-delete-directories-older-than-n-days . I hope I answered closer to your expectations this time :) C*heers, ----------------------- Alain Rodriguez - al...@thelastpickle.com France / Spain The Last Pickle - Apache Cassandra Consulting http://www.thelastpickle.com Le lun. 5 nov. 2018 à 21:09, Lou DeGenaro <lou.degen...@gmail.com> a écrit : > Alain, > > Thanks for the suggestion, but I think I did not make myself clear. In > order to utilize disk space efficiently, we want to keep snapshots that are > no older than X days old while purging the older ones. My understanding > is that there are 2 kinds of snapshots : (a) those created on demand by > given name and (b) those create automatically, for example as a result of a > TRUNCATE, that do not have a well known name. To get rid of the given name > ones (a) seems straight forward. How do I locate and get rid of the > automatically created (b) ones? > > Or if I am under some misconception, I'd be happily educated. > > Thanks. > > Lou. > > On Mon, Nov 5, 2018 at 3:49 PM Alain RODRIGUEZ <arodr...@gmail.com> wrote: > >> Hello Lou, >> >> how do you clear the automatic ones (e.g. names unknown) without clearing >>> the named ones? >>> >> >> The option '-t' might be what you are looking for: 'nodetool >> clearsnapshot -t nameOfMySnapshot'. >> >> From the documentation here: >> http://cassandra.apache.org/doc/latest/tools/nodetool/clearsnapshot.html?highlight=clearsnapshot >> >> Le lun. 5 nov. 2018 à 13:38, Lou DeGenaro <lou.degen...@gmail.com> a >> écrit : >> >>> The issue really is how to manage disk space. It is certainly possible >>> to take snapshots by name and delete them by name, perhaps one for each day >>> of the week. But how do you clear the automatic ones (e.g. names unknown) >>> without clearing the named ones? >>> >>> Thanks. >>> >>> Lou. >>> >>> On Fri, Nov 2, 2018 at 12:28 PM Oleksandr Shulgin < >>> oleksandr.shul...@zalando.de> wrote: >>> >>>> On Fri, Nov 2, 2018 at 5:15 PM Lou DeGenaro <lou.degen...@gmail.com> >>>> wrote: >>>> >>>>> I'm looking to hear how others are coping with snapshots. >>>>> >>>>> According to the doc: >>>>> https://docs.datastax.com/en/cassandra/3.0/cassandra/operations/opsBackupDeleteSnapshot.html >>>>> >>>>> *When taking a snapshot, previous snapshot files are not automatically >>>>> deleted. You should remove old snapshots that are no longer needed.* >>>>> >>>>> *The nodetool clearsnapshot >>>>> <https://docs.datastax.com/en/cassandra/3.0/cassandra/tools/toolsClearSnapShot.html> >>>>> command removes all existing snapshot files from the snapshot directory of >>>>> each keyspace. You should make it part of your back-up process to clear >>>>> old >>>>> snapshots before taking a new one.* >>>>> >>>>> But if you delete first, then there is a window of time when no >>>>> snapshot exists until the new one is created. And with a single snapshot >>>>> there is no recovery further back than it. >>>>> >>>> You can also delete specific snapshot, by passing its name to the >>>> clearsnapshot command. For example, you could use snapshot date as part of >>>> the name. This will also prevent removing snapshots which were taken for >>>> reasons other than backup, like the automatic snapshot due to running >>>> TRUNCATE or DROP commands, or any other snapshots which might have been >>>> created manually by the operators. >>>> >>>> Regards, >>>> -- >>>> Alex >>>> >>>>