Thread (13 messages) 13 messages, 3 authors, 2022-07-26

Re: Race condition between repack and loose-objects maintenance task

From: Gregory Szorc <hidden>
Date: 2022-07-20 01:42:47

On 6/29/2022 8:23 PM, Taylor Blau wrote:
On Wed, Jun 29, 2022 at 11:19:09PM -0400, Taylor Blau wrote:
quoted
quoted
However, I think there is yet another bug at play: running
`incremental-repack` appears to be able to repack the cruft packfile.
In doing so, it deletes its .mtimes file and the metadata inside.
That sounds like a bug to me. I'll take a look into it and see what I
can find.
I actually think that there are two bugs here.

One is that we run a MIDX repack and expire, which could lead to us
repacking the entire contents of the cruft pack and then expiring the
metadata file. This is a bug, and we should exclude cruft packs from
this computation.

Another bug can happen when the cruft pack gets written into the MIDX
and is MIDX-expireable (meaning that no objects are selected from the
cruft pack). In that case, the `git multi-pack-index expire` step would
remove the cruft pack entirely, which is also incorrect.

I'll take a look at fixing both of these, and thanks for pointing them
out!
For posterity, when I disabled cruft packfiles after having it enabled 
for a few weeks, the next `git gc` invocation on a high traffic repo 
resulted in >100k loose objects/files being created before they were 
summarily deleted by the GC's prune. This is significantly greater than 
the unreferenced object creation rate of the underlying repo. So it 
appears as if the MIDX stripping of the cruft packfile mtimes
effectively disabled pruning, leading to a build-up of unreferenced objects.

Fortunately I hadn't deployed cruft packfiles to production. If I had, 
the excessive filesystem churn on NFS would have caused an incident due 
to degraded performance.

Since the interaction between cruft packfiles and MIDX appears to be 
buggy, I think I'm going to leave cruft packfiles disabled until these 
features work better together.

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