Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty-pre-post cleanup deletes snapshots regardless of cleanup-algorithm setting #649

Open
tootea opened this issue May 5, 2021 · 1 comment

Comments

@tootea
Copy link

tootea commented May 5, 2021

Unlike the NumberCleaner and TimelineCleaner, the EmptyPrePosCleaner class in client/cleanup.cc does not check the configured cleanup algorithm in calculate_candidates, so it will delete any empty pre/post pair regardless of the cleanup algorithm setting. However, the Cleanup Algorithms section of the Snapper Tutorial claims the following:

Unless you have a good reason to do otherwise, you should always specify the cleanup algorithm when creating a
snapshot, otherwise the snapshot will never be deleted unless you do it manually. You do this by adding the following
to your snapper commands:
--cleanup-algorithm <number|timeline|empty-pre-post>

And later in that section:

Because no cleanup-algorithm is specified, the snapshot will never be deleted automatically.

When I made manual pre and post snapshots without specifying --cleanup-algorithm, they still got deleted by the cleaner soon afterwards.

Is this a code bug (EmptyPrePostCleaner should ignore snapshots without a cleanup-algorithm) or a documentation bug? If the latter, I would also recommend stressing in the manual that hand-creating pre/post pairs is likely not be the best idea and people should stick to "single" for any snapshots they want to keep.

@aschnell
Copy link
Member

aschnell commented May 6, 2021

This is a documentation bug.

Note that you can disable the empty-pre-post cleanup by setting EMPTY_PRE_POST_CLEANUP="no".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants