Compact tail packfiles#376
Open
mathieu-plak wants to merge 2 commits into
Open
Conversation
mathieu-plak
marked this pull request as draft
May 12, 2026 15:17
mathieu-plak
force-pushed
the
mm/compact_tail_packfiles
branch
from
May 12, 2026 15:33
76636ff to
1df0575
Compare
* Let's you iterate over the content of a packfile (index+associated data). On disk this is not the most efficient version but it ougth to be enough. * This will be used to implement compaction of tail pages.
mathieu-plak
force-pushed
the
mm/compact_tail_packfiles
branch
from
May 15, 2026 13:10
1df0575 to
8c486dc
Compare
* Because we pin one packfile per chunking goroutine, at the end of a run we possibly end up with a lot of really small packfiles. This create unecessary cruft (both in state and in the repo). * In order to mitigate this, when the run is ending we add a merge phase where we compact those packfiles into as little as possible.
mathieu-plak
force-pushed
the
mm/compact_tail_packfiles
branch
from
May 15, 2026 14:17
8c486dc to
5a79402
Compare
mathieu-plak
marked this pull request as ready for review
May 15, 2026 14:17
5 tasks
omar-polo
approved these changes
May 27, 2026
Comment on lines
+347
to
+348
| out := make([]byte, b.Length) | ||
| copy(out, p.Blobs[b.Offset:b.Offset+uint64(b.Length)]) |
Contributor
There was a problem hiding this comment.
just a question to validate my understanding: you're doing this to stay on the safe side, and because this is not particularly performance-sensitive (done once at the end) right?
because in theory, we could just pass a slice on p.Blobs, correct?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds compaction of tail packfiles in order to minimize the number of non-full packfiles we create
Still a draft as I want to measure performance with high concurrency number (thing like maxConcurrency set to 1000) and the on disk packfiles, just to be sure those ReadAt won't be too much. It's a one time thing so it shouldn't be too bad.