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

Re: [PATCH 2/2] upload-pack: don't ACK non-commits repeatedly in protocol v2

From
Patrick Steinhardt <ps@pks.im>
Date
Sep 5, 2025, 06:11 UTC
Message-ID
<aLp_JdWjpxF3sz17@pks.im>
In-Reply-To
<xmqqqzwm9nrt.fsf@gitster.g>
On Thu, Sep 04, 2025 at 09:37:58AM -0700, Junio C Hamano wrote:
Show 19 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > ... when the
> > server ACKs an object there is no reason for the client to go deeper, so
> > they stop advertising any of its parents.
> 
> Very true.  I did point out the difference in behaviour, but I
> couldn't actually figure out what goodness we are deriving in this
> code by marking grandparents (and possibly their ancestors) as
> something they have.  Your change in behaviour could be seen as
> stopping us from making unnecessary operations ;-)
> 
> If the other side is mischievous, they are not limited to feed us a
> commit and then its parent in the naturally expected order.  They
> could feed us A and then skip B and give us C that is a child of B.
> Pre-painting B when we got A from them, in order to prepare for
> seeing B (which we can return without doing anything) in the next
> round, would not help us all that much, if they give us C after
> giving us A, as we haven't even heard of C yet at that point.

Yeah, it _feels_ like the change should be fine overall. But honestly, I feel more comfortable with keeping the status quo for now so that the change is only doing what it's advertised to do, namely cull the memory growth.

So I'll apply the patch I had and send a v2, but we may think about the other angle as a #leftoverbit.

Show 7 quoted lines
> But in the normal case against sane clients that do not skip the
> probes, marking immediate parents (like B) when processing A might
> be helping?  I dunno.  I also somehow thought that even normal case
> we have an option to skip the probes in order to converge faster,
> but I am misremembering.
> 
> cf. https://lore.kernel.org/git/?q=upload-pack%20fibonacci
You probably mean `fetch.negotiationAlgorithm=skipping`?
Patrick
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 8 of 13 in “upload-pack: don't ACK non-commits repeatedly”
  1. 0/2 upload-pack: don't ACK non-commits repeatedlyPatrick Steinhardt, Sep 3, 2025
  2. 1/2 t5530: modernize testsPatrick Steinhardt, Sep 3, 2025
  3. Junio C HamanoSep 4, 2025
  4. 2/2 upload-pack: don't ACK non-commits repeatedly in protocol v2Patrick Steinhardt, Sep 3, 2025
  5. Junio C HamanoSep 4, 2025
  6. Patrick SteinhardtSep 4, 2025
  7. Junio C HamanoSep 4, 2025
  8. Patrick SteinhardtSep 5, 2025
  9. 0/2 upload-pack: don't ACK non-commits repeatedlyPatrick Steinhardt, Sep 5, 2025
  10. 1/2 t5530: modernize testsPatrick Steinhardt, Sep 5, 2025
  11. 2/2 upload-pack: don't ACK non-commits repeatedly in protocol v2Patrick Steinhardt, Sep 5, 2025
  12. Jeff KingSep 8, 2025
  13. Junio C HamanoSep 5, 2025

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.