-
Notifications
You must be signed in to change notification settings - Fork 249
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
zfs-auto-snap_daily - dataset already exists #118
Comments
Hello, I see the same error as @tonyblue2 using the zfs-auto-snap but only for the frequent snapshots appearing once per day. Hourly, daily etc. are running without problems:
The cron call is based on the project examples, running every 15 minutes and keeping 64 snapshots:
The cron job is run only once every 15 minutes and there are no multiple cron services running. Still the zfs-auto-snap log is all over the place, also repeating snapshots multiple times:
I also took a look at the script but could not see anything that would produce this behaviour. Manual creation of the snapshots did not reproduce the issue. I will try to debug this further and will post more verbose output if I can reproduce the issue manually. Thanks in advance. Lukas |
I found the problem for my case: With a high number of datasets in combination with HDDs which are not that fast, This resulted in the Cron forking various frequent snapshots, accumulating over time, that then used the same timestamp from the environment and resulted in the error "dataset already exists". This also happens for the hourly snapshot in times of high load (e.g. backups). |
That would make sense. I encountered this while a scrub was running, and after the scrub completed the errors stopped. I suppose the cron process could set up a lock, but perhaps this is best as documentation or a better error message. |
Having similar issues, but with the hourlies during low-load situations. Indeed, locking would be a good solution I think. |
Happens here too. Low load. Maybe all the scripts need to include something like
and them ( in my case, the issue was this cron bug : https://stackoverflow.com/questions/31886555/centos-6-7-cron-bug-run-parts-starts-twice, but it'd be easy to reduce the foot gun chances here ) |
One way to fix this would be to use systemd timers rather than cron scripts. You can configure each timer using OnUnitActiveSec so it will run on an interval based on the finish time, rather than the start time. Of course systemd can be controversial. I'm willing to make & contribute the fix if it's an acceptable change. |
Hello,
I installed zfs-auto-snapshot to get snapshots of my datasets.
So far, it works quite well. But once a week I get the error message:
/etc/cron.daily/zfs-auto-snapshot:
Somehow it seems like a second call to zfs-auto-snapshot - doesn't it?
Maybe someone has a tip for me how to find out?
Thank you so much!
Tony
The text was updated successfully, but these errors were encountered: