Thread (41 messages) 41 messages, 5 authors, 13d ago

Re: [PATCH v2 8/8] repack: include required packs in incremental MIDX writes

flat view

From: Taylor Blau <hidden>
Date: 2026-10-03 01:02:04

On Fri, Oct 02, 2026 at 07:41:57PM -0400, Jeff King wrote:
On Wed, Sep 30, 2026 at 11:12:05PM -0500, Taylor Blau wrote:
quoted
The geometric plan from 1da62fb5c86 (repack: implement incremental MIDX
repacking, 2026-05-19) can omit kept and cruft packs, since neither
necessarily participates in the geometric repack. Such packs can also be
lost when replacing a tip layer that contains them. Neither plan
consults `midx_included_packs()`, so the rules for retaining cruft in
ordinary MIDX writes do not protect incremental writes.

Use that selection logic to add missing packs to each plan's write step.
Skip packs in retained base layers, but include required packs from a
replaced tip. Count added objects when choosing which layers to compact,
without changing the preferred pack.
I admit I had a hard time following this patch. I think the point is
that we're going to include some packs in the midx that were not covered
previously. But it was hard to see where that happens. I think the magic
bit is this:
quoted
@@ -557,17 +604,20 @@ static void repack_make_midx_append_plan(struct repack_write_midx_opts *opts,
 					 size_t *steps_nr_p)
[..]
-	for (i = 0; i < opts->names->nr; i++) {
+	midx_included_packs(&include, opts, m);
where we rely on midx_included_packs() to do that selection.
Yeah, that's right. I wrote this code in the first place, and it wasn't
even *that* long ago and I had to spend a not-insignificant amount of
time (re)acquainting myself with this area before writing this patch.

Thanks,
Taylor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help