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

Disable snapshots while zfs receive is running on a dataset #1590

Closed
prakashsurya opened this issue Jul 15, 2013 · 4 comments
Closed

Disable snapshots while zfs receive is running on a dataset #1590

prakashsurya opened this issue Jul 15, 2013 · 4 comments
Milestone

Comments

@prakashsurya
Copy link
Member

It would be nice to disable snapshot creation on pools that have an in progress zfs receive running.

This was a headache when trying to migrate data to new disks in a home NAS setup with zfs-auto-snapshot scripts installed. Part way into the zfs send | zfs receive I would get a failure and the process would end after a few hours of runtime. After a few wasted days, I finally disabled the auto snapshots and everything migrated without a hitch.

To prevent future frustration, it would be great if ZFS could handle this in a better way; perhaps by returning an error to the snapshot creation process (e.g. EBUSY) instead of the data set receive process.

@ahrens
Copy link
Member

ahrens commented Jul 15, 2013

The bug (user-observed bad behavior) here is that an incremental "zfs receive" will fail if a snapshot was created while the receive is in progress. The receive will also fail if a snapshot exists before the receive starts.

I think the suggested fix (to disable snapshots while zfs receive is in progress) is prone to a race condition: a snapshot may be created just before the receive starts. If the -F flag is not used, then the receive will fail in this case as well.

I have fixed this in DelphixOS by making "zfs receive -F" remove snapshots after the incremental source snapshot. These snapshots may be been created while the receive was in progress, or before it started. We are working on getting this fix integrated into Illumos.

@csiden
Copy link

csiden commented Jul 15, 2013

I should have this pushed to illumos within a few days: https://www.illumos.org/issues/3888

@prakashsurya
Copy link
Member Author

If I'm understanding correctly, I think that solution will cover my use case. Glad to hear there's already efforts being done to address it! If that work makes into Illumos and then trickles down into this port, I'll be happy with that.

@behlendorf
Copy link
Contributor

This should be fixed, https://www.illumos.org/issues/3888 was merged as 1958067

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

4 participants