Closed lowjoel closed 2 months ago
Oh, it's a limitation on zfs recv
:
If an incremental stream is received, then the destination file system must already exist, and its most recent snapshot must match the incremental stream's source. For zvols, the destination device link is destroyed and recreated, which means the zvol cannot be accessed during the receive operation.
Closing 🙇
yep, works as designed :)
a solution would be to do make the thinning on the source side a bit later, if you have the space. Or use --destroy-incompatible to automatically destroy snapshots that are in the way.
I'm using zfs_autobackup to perform backups onto different sets of media locally, including one set of offsite backups.
I've swapped my media such that now I am updating the old set of media with new snapshots, but the media contains thinned snapshots. In this example with fictional dates:
Essentially, on 20240705:
zfs-autobackup erroneously detects 20240701... and 20240702... as incompatible and refuses to backup the newer snapshot (20240705...)
I've dug through the code and found that the method for computing incompatible snapshots are at c52857@zfs_autobackup/ZfsDataset.py#L920. Only snapshots that have 0
written
are compatible -- but the definition ofwritten
in zfsprops(7):This means that any snapshot that has a child, even if from the same ancestry, would be considered incompatible. Interestingly, even the 20240702... snapshot on the backup medium has a written != 0.
My current workaround is to manually delete the snapshots and I'm OK with this. But I think the off site backup strategy is something we should support. I'll trawl through the code to figure out if I can fix it.