-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 send | zfs receive fails on zvols that have additional snapshots #692
Comments
Did rpool/BACKUP/vserver/KVM/minix exists at that time, and if so: was it in use? |
It did not exist prior to the transfer. |
./lib/libzfs/libzfs_dataset.c calls an ioctl with ZFS_IOC_REMOVE_MINOR. When multiple snapshots of a zvol are encountered, this fails and the above error message is printed. It would seem that zv_open_count is being increased for each descendant snapshot. I am still looking into the how that happens. |
I also deleted the additional snapshots, which worked as a hack to resolve the issue. I subsequently tried (and failed) to reproduce this with new snapshots. This occurred following the use of sync=disabled on a zvol and system instability. I guess that some sort of high level corruption ocurred, which deleting the old snapshots fixed. With that said, I cannot identify the cause of zv_open_count being set to a value greater than zero. I will leave the decision to close this to Brian. |
The zv_open_count in incremented/decremented when the zvol is opened/closed by any userspace process. This behavior is similar to Solaris but not identical so there might be an issue here. In particular, I don't believe snapshots of zvols are accessible under Solaris. Anyway, let's leave the issue open until we resolve the root cause. |
snapshot of zvols are accessible under solaris and sending rpool/zvol@Y to another pool works. I use this feature on opensolaris to backup volume like this: So there is a linux issue here. |
I've been investigating this error in a case where it occurs consistently and found some interesting facts. cannot remove device links for 'ibackup2/linux_master32': dataset is busy First fact, when commenting the udev rule in Also, when tracing the code with gdb and letting it pause just before stepping in It may be relevant that the input stream contains volumes with partitions. The whole set of links actually created at the end of the operation when it's successful is: linux_master32 linux_master32@20110207 linux_master32@20110207-part1 linux_master32@20110207-part2 linux_master32@20110207-part3 linux_master32@20110207-part4 linux_master32@last_snap linux_master32@last_snap-part1 linux_master32@last_snap-part2 linux_master32@last_snap-part3 linux_master32@last_snap-part4 linux_master32-part1 linux_master32-part2 linux_master32-part3 linux_master32-part4 linux_master32@snap linux_master32@snap-part1 linux_master32@snap-part2 linux_master32@snap-part3 linux_master32@snap-part4 I've observed that For the reasons above, I suspect that the root cause of the problem is a race condition between the asynchronous creation of this link by udev and its almost immediate destruction by zfs receive. The code in libzfs_dataset.c:zvol_create_link_common() has a loop waiting for the device link to appear, but maybe it's not sufficient? Hope this helps. |
Slightly reworked but the intent of the patch remains the same. Merged in to master. |
) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.144 to 1.0.152. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.144...v1.0.152) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
If I have a rpool/zvol@X and rpool/zvol@Y and I try to send rpool/zvol@Y to another pool, rpool/zvol@X will be transfered and then a failure will occur. I had this happen to me a few times before I realized that this was happening. The following illustrates this:
In this case, both rpool/KVM/minix@backup and rpool/KVM/minix@install exist. Trying to send either will result in an error. I opted to delete rpool/KVM/minix@backup, rollback to rpool/KVM/minix@install and then rename rpool/KVM/minix@install to rpool/KVM/minix@backup. Had this been a dataset, both snapshots would have been transferred without a problem.
The text was updated successfully, but these errors were encountered: