git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Performance regression in connectivity check during receive-pack (git 2.54)

From
Jeff King <peff@peff.net>
Date
Jul 23, 2026, 10:46 UTC
Message-ID
<20260723104625.GB604358@coredump.intra.peff.net>
In-Reply-To
<amCuLpT6vYzo1GF8@pks.im>
On Wed, Jul 22, 2026 at 01:49:02PM +0200, Patrick Steinhardt wrote:
Show 14 quoted lines
> Seeing that this is about the `tmp_objdir` case: one of the things that
> Justin and I wanted to work on anyway is that we want to stop modifying
> the list of sources during transactions in the first place. It always
> felt kind of gross that we're modifying the sources when creating a
> transaction, as the only reason that we do this for is so that the
> writes actually go to the temporary object directory instead of to the
> primary object source. And that doesn't make a lot of sense to begin
> with.
> 
> The alternative to this would be to instead have logic in functions like
> `odb_write()` that checks whether we have an active transaction or not.
> If so, the write would go into the transaction directly instead of going
> into the primary source, and consequently we wouldn't even have to
> modify the list of sources at all.

Yes, the swapping of the "regular" and "alternate" odbs for the quarantine transaction is kind of hacky. But I don't think this is something you can solve just via the odb API. The notion of which sources to read/write from crosses process boundaries. In particular:

  1. We write using a separate index-pack process. It has to be told to
     write into the transaction area, not the regular odb.
  2. After receiving objects, we _do_ read them in order to do quality
     checks before admitting them to the repository. The connectivity
     check discussed here is one example. That happens in a separate
     rev-list process, though it in theory could be moved in-process.
     But we also run user-specified hooks, which may run arbitrary Git
     commands. Those hooks need to be given an environment where they
     can transparently read from both the quarantine area and the
     original odb.

So you'll have to communicate between processes both "write here, not there" and "look at both here and there to read objects". And I suspect the result is going to look a lot like the alternates juggling we are doing today.

-Peff
Previous: Patrick SteinhardtNext: Jeff King
Message 12 of 13 in “Performance regression in connectivity check during receive-pack (git 2.54)”
  1. Wolfgang KritzingerJul 21, 2026
  2. Jeff KingJul 21, 2026
  3. Taylor BlauJul 21, 2026
  4. Junio C HamanoJul 21, 2026
  5. Patrick SteinhardtJul 22, 2026
  6. Junio C HamanoJul 22, 2026
  7. Jeff KingJul 23, 2026
  8. Patrick SteinhardtJul 24, 2026
  9. Jeff KingJul 26, 2026
  10. Justin ToblerJul 27, 2026
  11. Patrick SteinhardtAug 4, 2026
  12. Jeff KingJul 23, 2026
  13. Jeff KingJul 23, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.