Skip to content

prune: correctly account for duplicates in max-unused check#5212

Merged
MichaelEischer merged 1 commit intorestic:masterfrom
MichaelEischer:prune-fix-unused-size-duplicates
Jan 26, 2025
Merged

prune: correctly account for duplicates in max-unused check#5212
MichaelEischer merged 1 commit intorestic:masterfrom
MichaelEischer:prune-fix-unused-size-duplicates

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer commented Jan 18, 2025

What does this PR change? What problem does it solve?

The size comparison for --max-unused only accounted for unused but not for duplicate data. For repositories with a large amount of duplicates this can result in a situation where no data gets pruned even though the amount of unused data is much higher than specified.

Was the change previously discussed in an issue or on the forum?

Fixes https://forum.restic.net/t/restic-not-obeying-max-unused-parameter-on-prune/8879/10 .

Checklist

  • I have added tests for all code changes.
  • I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I'm done! This pull request is ready for review.

@MichaelEischer MichaelEischer force-pushed the prune-fix-unused-size-duplicates branch from 6771ffe to 6eec561 Compare January 19, 2025 15:25
@MichaelEischer MichaelEischer marked this pull request as ready for review January 19, 2025 15:25
@MichaelEischer MichaelEischer force-pushed the prune-fix-unused-size-duplicates branch from 6eec561 to ad74c04 Compare January 19, 2025 15:26
The size comparison for `--max-unused` only accounted for unused but not
for duplicate data. For repositories with a large amount of duplicates
this can result in a situation where no data gets pruned even though
the amount of unused data is much higher than specified.
@MichaelEischer MichaelEischer force-pushed the prune-fix-unused-size-duplicates branch from ad74c04 to 9331461 Compare January 19, 2025 16:47
Copy link
Copy Markdown
Member Author

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@MichaelEischer MichaelEischer merged commit fde6413 into restic:master Jan 26, 2025
@MichaelEischer MichaelEischer deleted the prune-fix-unused-size-duplicates branch January 26, 2025 21:07
@darkdragon-001 darkdragon-001 mentioned this pull request Feb 5, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant