-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Feature request: Prune (or skip on creation) empty snapshots #728
Comments
I use a threshold hook script to decide whether or not to snapshot. It looks at a configurable property to determine if at least that many bytes have been written to the dataset. For example, on the root dataset I have it set to 100M - don't really care if I miss changes smaller than that. Other datasets it's set to lower values. So every 15mins when zrepl snaps, that script prevents some/many snaps from happening. Unfortunately they show up as errors, but that's OK.
|
Ah, great. Didn’t think of using hooks. That sounds like a reasonable solution for now. |
@Halfwalker putting the threshold logic into a hook is a cool idea. Just for completeness, I assume you use Looking at the OpenZFS source code: the We could definitely get it as part of the The only question is how to hook it up in the config. I have some longer-arching plans for how to evolve snapshot management, but, in the meantime, maybe we can either
(1) is pretty much self-describing. It seems quite general, but, I'd prefer capturing common use cases through YAML configuration instead of shell hooks. Hence, an outline of (2): The skip decider would run for each filesystem that passes the
Let me know what you think! |
Yup, I currently use I do like the idea of formalizing things in the yaml, but also with the capability to shell out to handle arbitrary conditions. From your description above it looks like one would define several That sounds cool, flexible. You could use the same mechanism possibly for the push jobs. I can think of several possibilities -
|
When you use the If you think 2/3 of your snapshots can be skipped by using this, that's a lot errors that will flood your log monitoring. |
We are regularly snapshotting hundreds of people’s home folders and other data, eventually giving us between 10000 (still fine) and 100000 (things are getting much slower) snapshots on one of our storage systems.
While on its own this is not much of a problem, eventually
zfs list
will take a long time to complete (and I presume some of zrepls features that need a global refresh, will also take longer) with that many snapshots. (And some badly written shell-autocompletion scripts suddenly need 2 minutes to fill in a letter.)In our case a lot of these file systems do not change regularly (especially not during nighttime hours) so we could probably get rid of > 2/3 of these snapshots by simply pruning empty snapshots that do not contain any new information.
Would it be feasible to have something like this built into zrepl? Either as an additional pruning rule or already at snapshot-creation time (just don’t create a new snapshot when nothing has changed).
The text was updated successfully, but these errors were encountered: