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

Snapshots range with zfs holds #13306

Open
rightaway opened this issue Apr 8, 2022 · 1 comment
Open

Snapshots range with zfs holds #13306

rightaway opened this issue Apr 8, 2022 · 1 comment
Labels
Type: Feature Feature request or new feature

Comments

@rightaway
Copy link

Describe the feature would like to see added to OpenZFS

zfs holds should allow the same % notation like zfs destroy, so zfs holds pool/dataset@% should show holds for all snapshots just like zfs destroy pool/dataset@% destroys all snapshots.

How will this feature improve OpenZFS?

When tags are used with replication the most common pattern is create a tag from the last replication snapshot and remove the tag from the previous one. But when resuming a replication with receive_resume_token there's no way to tell which both of those snapshots were, so you don't know what to run zfs release on. To find out which one you have to pass a list of all the snapshots to zfs holds, but how many you can pass is limited by the shell. Or you can run zfs holds for every snapshot which is inefficient and slow especially if it's over ssh.

And it will be useful when zfs release fails for any reason like due to a bad ssh connection. Since zfs hold and zfs release can't be combined into an atomic operation there are times when you'll have a leftover tag that you don't know about, and replication will fail in the future when it tries to destroy a snapshot with a tag on it. By passing a range with % you can efficiently see the holds on all snapshots you're interested in and do clean up if necessary.

Additional context

It will make zfs holds more consistent with zfs destroy.

@dawidmachon
Copy link

+1 fot this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Feature request or new feature
Projects
None yet
Development

No branches or pull requests

2 participants