From: Patrick Steinhardt <ps@pks.im>
To: Elijah Newren <newren@gmail.com>
Cc: git@vger.kernel.org, Stefan Haller <lists@haller-berlin.de>
Subject: Re: [PATCH] odb/files: be less aggressive with geometric repacking
Date: Fri, 21 Aug 2026 13:40:15 +0200 [thread overview]
Message-ID: <aog5Hwp5EQA0k500@pks.im> (raw)
In-Reply-To: <CABPp-BHgyVTHB_OGmCL4JprFFe6_MapOQNSjUOhJxu-+oWbErg@mail.gmail.com>
On Thu, Aug 20, 2026 at 11:40:46PM -0700, Elijah Newren wrote:
> On Tue, Aug 11, 2026 at 2:17 AM Patrick Steinhardt <ps@pks.im> wrote:
[snip]
> > Being this aggressive is also causing problems as reported by our users.
> > When running lots of concurrent writers, those writes will constantly
> > end up spawning maintenance jobs that end up repacking objects. As we
> > also prune objects, a concurrently running process that tries to write
> > an object may see that the sharding directories get removed under their
> > feet. While we try re-creating such leading directories, we only do so a
> > single time, and it may happen that the directory vanishes again before
> > we had the chance to create the loose object. This is not a new problem,
> > but it is exacerbated by us running maintenance this aggressively.
>
> Unrelated to this patch...but should git avoid pruning the loose
> object sharding directories?
I was wondering about that, too. There are two contradicting arguments
to make here:
- Pruning the sharding directories allows us to quickly determine that
an empty shard cannot have an object.
- Not pruning the sharding directories may avoid a lot of write churn.
The question is how large the impact of these two individual arguments
is.
By gut feeling, I think that the first argument is somewhat weak. Not
having empty directories means that looking up a loose object by its
path will be slightly faster because we have to walk one less directory
in the hierarchy. But this really only matters in the case where we look
for a nonexistent object, which does not happen all that often because
we prefer searching packfiles first.
Furthermore, iterating through all objects in the object database will
be faster, as we don't have to open each of the directories only to find
them empty. But again, that's not really something that we do all that
frequently.
On the other hand, we _do_ have to recreate the loose object shards
quite frequently as that's how we write data into a repository. And as
we've seen, pruning those shards can easily cause races.
So in the end I think it could be a useful thing to explore. The only
thing I wonder is whether there's a good reason for why we prune those
that I miss.
Patrick
prev parent reply other threads:[~2026-08-21 11:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 9:04 [PATCH] odb/files: be less aggressive with geometric repacking Patrick Steinhardt
2026-08-11 20:44 ` Justin Tobler
2026-08-12 5:44 ` Patrick Steinhardt
2026-08-18 22:34 ` Justin Tobler
2026-08-19 4:52 ` Patrick Steinhardt
2026-08-21 6:34 ` Patrick Steinhardt
2026-08-21 6:40 ` Elijah Newren
2026-08-21 11:40 ` Patrick Steinhardt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aog5Hwp5EQA0k500@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=lists@haller-berlin.de \
--cc=newren@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox