jimsalterjrs / sanoid

These are policy-driven snapshot management and replication tools which use OpenZFS for underlying next-gen storage. (Btrfs support plans are shelved unless and until btrfs becomes reliable.)
http://www.openoid.net/products/
GNU General Public License v3.0
3.14k stars 308 forks source link

Syncoid: sync incremental - hold selected snapshots during sync #924

Open NicholasRush opened 6 months ago

NicholasRush commented 6 months ago

Hi there,

i have tested sanoid so much and it is a great tool, but there is a problem when it comes to exclude or include snapshots. The problem is, that the incremental snapshots on the source could be delete through a snapshotengine during the sync. The best would be to hold all these snaps during the sync. If the sync is interrupted, it should check if theres a previous hold tag, finish the sync and remove all holds of the prevoious selected snapshots.

phreaker0 commented 5 months ago

@NicholasRush if a snapshot is being used in an ongoing send it can't be destroyed AFAIK and zfs will return an "busy" error.

jimsalterjrs commented 5 months ago

@NicholasRush if a snapshot is being used in an ongoing send it can't be destroyed AFAIK and zfs will return an "busy" error.

Can confirm; I've tested this extensively while making certain syncoid didn't have unexpected failure modes. If the snapshot is necessary for replication to continue, the destroy operation fails "snapshot busy". If the snapshot isn't necessary for replication to continue, the destroy operation succeeds.