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

Re: [PATCH] upload-pack: do not lazy-fetch "have" objects

From
Jeff King <peff@peff.net>
Date
Jul 16, 2020, 10:41 UTC
Message-ID
<20200716104149.GA376357@coredump.intra.peff.net>
In-Reply-To
<xmqqpn8wie21.fsf@gitster.c.googlers.com>
On Wed, Jul 15, 2020 at 03:55:18PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Fixing issues hit by real users reactively is a necessary and good
> thing, but this is not the first time we patch callers of
> has_object_file() for this kind of "we are merely trying to
> determine the boundary of what we have, so that we know what we need
> to add to this repository" queries, I am afraid.
> 
> Perhaps it is a good idea to sweep all the hits from "git grep -e
> has_object_file \*.c" and audit the codebase to see if there are
> other problematic ones?

Interestingly, the case fixed here was mentioned after the three-dashes in this patch:

  https://lore.kernel.org/git/20191127123211.GG22221@sigill.intra.peff.net/

That thread was about OBJECT_INFO_QUICK, but I think any "we are finding the boundary" hunt should consider whether that's appropriate, too. In that case they are really the same issue: we do not want to expend effort A on the unlikely chance P that we will find the object and save ourselves effort B. The magnitude of A and B, and the probability P may be different for the two optimizations, though.

I think the instance fixed here _probably_ could be converted to QUICK as well. It saves extra refreshes of the pack directory when a client asks for an object we don't have. That's usually not too expensive, but can be in some cases (many alternates, slow NFS filesystems, client has many objects we don't). In the worst case, using QUICK would mean we can get fooled by a simultaneous repack into thinking we don't have an object we _do_ have, and end up negotiating a worse pack for the client.

> Thanks.  Will queue.

That said, yeah, I think Jonathan's patch is a strict improvement by itself.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “upload-pack: do not lazy-fetch "have" objects”
  1. upload-pack: do not lazy-fetch "have" objectsJonathan Tan, Jul 15, 2020
  2. Junio C HamanoJul 15, 2020
  3. Jeff KingJul 16, 2020
  4. Junio C HamanoJul 16, 2020
  5. upload-pack: do not lazy-fetch "have" objectsJonathan Tan, Jul 16, 2020
  6. Jeff KingJul 20, 2020

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.