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

Re: [RFC PATCH v4 06/26] Add multi_ack_detailed capability to fetch-pack/upload-pack

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 29, 2009, 16:17 UTC
Message-ID
<20091029161748.GB10505@spearce.org>
In-Reply-To
<7v4opibv4i.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> 
> > ACK %s
> > -----------------------------------
> >   * no multi_ack or multi_ack_detailed:
> >
> >     Sent in response to "have" when the object exists on the remote
> >     side and is therefore an object in common between the peers.
> >     The argument is the SHA-1 of the common object.
> 
> Do you mean by "exists" something a bit stronger than that, namely, it
> exists and everything reachable from it also exists, right?

No, I mean "object exists". The upload-pack code makes no check that the object is in fact complete, just that it has the object in the object database. The object could be a dangling commit whose parents aren't present, and we'd still (currently) return an "ACK %s" for it.

I specifically didn't get into completeness here because we don't
actually check for it.
 
Show 36 quoted lines
> > ACK %s common
> > -----------------------------------
> >   * multi_ack_detailed only:
> >
> >     Sent in response to "have".  Both sides have this object.
> >     Like with "ACK %s continue" above the client should stop
> >     sending have lines reachable for objects from the argument.
> >
> > ACK %s ready
> > -----------------------------------
> >   * multi_ack_detailed only:
> >
> >     Sent in response to "have".
> >
> >     The client should stop transmitting objects which are reachable
> >     from the argument, and send "done" soon to get the objects.
> >
> >     If the remote side has the specified object, it should
> >     first send an "ACK %s common" message prior to sending
> >     "ACK %s ready".
> >
> >     Clients may still submit additional "have" lines if there are
> >     more side branches for the client to explore that might be added
> >     to the common set and reduce the number of objects to transfer.
> 
> I do not understand this after reading it three times.  The remote side
> says "ACK $it common", allow the requestor to feed more "have", then
> eventually send an "ACK $it ready" for the same object it earlier sent
> "common" for?  The first one tells the requestor not to go down the path
> from $it further, so presumably all the "have"s that come after it will be
> about different ancestry paths.
> 
> What is the advantage of using this?  In other words, how, in what
> situation and why would the remote side choose to use "ready" --- it looks
> to me that it could always say "common" whenever it hits a "have" that it
> can determine to be common.
"ACK $it ready" should be used when ok_to_give_up() returns true.

The "ACK $it ready" message is trying to say "don't talk any more about things reachable from $it, and by the way, if you say 'done' now I will give you a pack".

The "ACK $it common" message is trying to say "$it is a common base, don't talk any more about things reachable from $it, but there may be other branches you should explore before I send you a pack, so talk about those if you can".

A client only wants to store $it into its request state vector for replay on the next RPC if $it is truely common.

The "ACK $it common" before "ACK $it ready" is because clients can't assume that "ACK $it ready" means $it is really common. Servers send "ACK $it ready" if they don't have $it but are ok_to_give_up(). But if it is common, *and* ok_to_give_up() is true, a server can send both messages, but it must send "ACK $it common" first.

-- 
Shawn.
Previous: Junio C HamanoNext: Shawn O. Pearce
Message 20 of 60 in “Return of smart HTTP”
  1. 00/26 Return of smart HTTPShawn O. Pearce, Oct 29, 2009
  2. 01/26 http-push: fix check condition on http.c::finish_http_pack_request()Shawn O. Pearce, Oct 29, 2009
  3. 02/26 pkt-line: Add strbuf based functionsShawn O. Pearce, Oct 29, 2009
  4. 03/26 pkt-line: Make packet_read_line easier to debugShawn O. Pearce, Oct 29, 2009
  5. Junio C HamanoOct 29, 2009
  6. Shawn O. PearceOct 29, 2009
  7. Junio C HamanoOct 29, 2009
  8. Shawn O. PearceOct 29, 2009
  9. Jeff KingOct 30, 2009
  10. Shawn O. PearceOct 30, 2009
  11. Jeff KingOct 30, 2009
  12. David BrownOct 30, 2009
  13. Junio C HamanoOct 30, 2009
  14. 04/26 fetch-pack: Use a strbuf to compose the want listShawn O. Pearce, Oct 29, 2009
  15. 05/26 Move "get_ack()" back to fetch-packShawn O. Pearce, Oct 29, 2009
  16. Junio C HamanoOct 29, 2009
  17. Shawn O. PearceOct 29, 2009
  18. 06/26 Add multi_ack_detailed capability to fetch-pack/upload-packShawn O. Pearce, Oct 29, 2009
  19. Junio C HamanoOct 29, 2009
  20. Shawn O. PearceOct 29, 2009
  21. 07/26 remote-curl: Refactor walker initializationShawn O. Pearce, Oct 29, 2009
  22. 08/26 fetch: Allow transport -v -v -v to set verbosity to 3Shawn O. Pearce, Oct 29, 2009
  23. 09/26 remote-helpers: Fetch more than one ref in a batchShawn O. Pearce, Oct 29, 2009
  24. 10/26 remote-helpers: Support custom transport optionsShawn O. Pearce, Oct 29, 2009
  25. 11/26 Move WebDAV HTTP push under remote-curlShawn O. Pearce, Oct 29, 2009
  26. Tay Ray ChuanOct 30, 2009
  27. Shawn O. PearceOct 31, 2009
  28. Tay Ray ChuanOct 30, 2009
  29. Clemens BuchacherOct 30, 2009
  30. Tay Ray ChuanOct 30, 2009
  31. 12/26 remote-helpers: return successfully if everything up-to-dateShawn O. Pearce, Oct 29, 2009
  32. 13/26 Git-aware CGI to provide dumb HTTP transportShawn O. Pearce, Oct 29, 2009
  33. 14/26 Add stateless RPC options to upload-pack, receive-packShawn O. Pearce, Oct 29, 2009
  34. Junio C HamanoOct 29, 2009
  35. Shawn O. PearceOct 29, 2009
  36. Junio C HamanoOct 29, 2009
  37. Shawn O. PearceOct 30, 2009
  38. 15/26 Smart fetch and push over HTTP: server sideShawn O. Pearce, Oct 29, 2009
  39. 16/26 http-backend: add GIT_PROJECT_ROOT environment varShawn O. Pearce, Oct 29, 2009
  40. 17/26 http-backend: reword some documentationShawn O. Pearce, Oct 29, 2009
  41. 18/26 http-backend: use mod_alias instead of mod_rewriteShawn O. Pearce, Oct 29, 2009
  42. 19/26 http-backend: add example for gitweb on same URLShawn O. Pearce, Oct 29, 2009
  43. 20/26 http-backend: more explict LocationMatchShawn O. Pearce, Oct 29, 2009
  44. 21/26 Discover refs via smart HTTP server when availableShawn O. Pearce, Oct 29, 2009
  45. 22/26 Smart push over HTTP: client sideShawn O. Pearce, Oct 29, 2009
  46. 23/26 Smart fetch over HTTP: client sideShawn O. Pearce, Oct 29, 2009
  47. 24/26 Smart HTTP fetch: gzip requestsShawn O. Pearce, Oct 29, 2009
  48. 25/26 t5540-http-push: remove redundant fetchesShawn O. Pearce, Oct 29, 2009
  49. 26/26 test smart http fetch and pushShawn O. Pearce, Oct 29, 2009
  50. Clemens BuchacherOct 29, 2009
  51. Shawn O. PearceOct 29, 2009
  52. Junio C HamanoOct 29, 2009
  53. Shawn O. PearceOct 29, 2009
  54. Shawn O. PearceOct 29, 2009
  55. Junio C HamanoOct 30, 2009
  56. Shawn O. PearceOct 30, 2009
  57. Tay Ray ChuanOct 30, 2009
  58. Shawn O. PearceOct 31, 2009
  59. Jakub NarebskiOct 29, 2009
  60. Shawn O. PearceOct 29, 2009

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.