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

--force-delete does not seem to delete datasets #932

Closed Derkades closed 5 months ago

Derkades commented 5 months ago

My command is:

syncoid --no-privilege-elevation --recursive --no-sync-snap --no-rollback --force-delete "root@host:pool" "backup/<local_dataset>"

For each snapshot, it prints a success message for each child dataset, and no warnings. However, datasets that have been deleted on the source, remain on the destination. This triggers warnings in my monitoring system, which checks the recency of snapshots on the target.

I have tested this using the latest master and 2.1.0.

phreaker0 commented 5 months ago

"--force-delete" won't delete datasets which are not synced, from the readme:

--force-delete

Remove target datasets recursively (WARNING: this will also affect child datasets with matching snapshots/bookmarks), if there are no matching snapshots/bookmarks. Also removes conflicting snapshots if the replication would fail because of a snapshot which has the same name between source and target but different contents.

Derkades commented 5 months ago

Thanks for the response, so I don't understand the wording in the readme. Does that mean datasets on the target are deleted only when the dataset exists on the source but has no matching snapshots? So not if the dataset is deleted at the source?

Is there any way to accomplish such a recursive sync using sanoid and syncoid, where datasets deleted on the source are also (eventually) deleted on the target?