Skip to content

Compute packsizes in MasterIndex#3101

Merged
fd0 merged 5 commits intorestic:masterfrom
aawsome:packsizes
Nov 22, 2020
Merged

Compute packsizes in MasterIndex#3101
fd0 merged 5 commits intorestic:masterfrom
aawsome:packsizes

Conversation

@aawsome
Copy link
Copy Markdown
Contributor

@aawsome aawsome commented Nov 16, 2020

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

Cleans up code where pack (header) sizes are computed from index entries.
Now all code which takes assumptions on the pack format is either in internal/pack or in MasterIndex.PackSize(). This makes modification to the pack format more easy in the future.

This PR introduces a small change in the new pruning algorithm (see #2718): Now the complete header is treated as "used space" within a pack, whereas before only the header length and header crypto were treated as "used space" + only the header entries of really used blobs. The difference however should be marginal and may only slightly change the decision which pack to repack and which to keep.

Was the change discussed in an issue or in the forum before?

see #3006

Checklist

  • I have read the Contribution Guidelines
  • I have enabled maintainer edits for this PR
  • I have added tests for all changes in this PR
  • I have not added documentation for the changes (in the manual)
  • There's no new file in changelog/unreleased/ that describes the changes for our users - this is too technical for users to notice.
  • I have run gofmt on the code in all commits
  • All commit messages are formatted in the same style as the other commits in the repo
  • I'm done, this Pull Request is ready for review

Copy link
Copy Markdown
Member

@fd0 fd0 left a comment

Choose a reason for hiding this comment

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

LGTM, apart from the docs for ListPack() :)

@aawsome
Copy link
Copy Markdown
Contributor Author

aawsome commented Nov 21, 2020

Also rebased this to master as #3113 was merged.

Copy link
Copy Markdown
Member

@fd0 fd0 left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@fd0 fd0 merged commit c844580 into restic:master Nov 22, 2020
@aawsome aawsome deleted the packsizes branch November 22, 2020 18:23
This was referenced Nov 22, 2020
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.

2 participants