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

Re: Stalled git cloning and possible solutions

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 30, 2013, 12:41 UTC
Message-ID
<CACsJy8DntFs-exeQ28=tqF3963zd1szTghZybmC6DrTNNF8Lfg@mail.gmail.com>
In-Reply-To
<CACsJy8CxeZGu-nudeGtAFJdzsYMjyNX01yeVOAcRV1kOjA+dkg@mail.gmail.com>
On Fri, Aug 30, 2013 at 7:17 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 24 quoted lines
> OK how about a new capability "resume" to upload-pack. fetch-pack can
> then send capability "resume[=<SHA-1>,<skip>]" to upload-pack. The
> first time it sends "resume" without parameters, and upload-pack will
> send back an SHA-1 to identify the pack being transferred together
> with a full pack as usual. When early disconnection happens, it sends
> the received SHA-1 and the received pack's size so far. It either
> receives the remaining part, or a full pack.
>
> When upload-pack gets "resume", it calculates a checksum of all input
> that may impact pack generation. If the checksum matches the SHA-1
> from fetch-pack, it'll continue to generate the pack as usual, but
> will skip sending the first <skip> bytes (maybe with a fake header so
> that fetch-pack realizes this is a partial pack). If the checksum does
> not match, it sends full pack again. I count on index-pack to spot
> corrupt resumed pack due to bugs.
>
> The input to calculate SHA-1 checksum includes:
>
>  - the result SHA-1 list from rev-list
>  - git version string
>  - .git/shallow
>  - replace object database
>  - pack.* config
>  - maybe some other variables (I haven't checked pack-objects)

should have tested something first before I wrote. --threads adds some randomness to pack generation so it has to be --threads=1. Not sure if git repository hosts are happy with it..

Show 12 quoted lines
> Another Git implementation can generate this SHA-1 in a totally
> different way and may even cache the generated pack.
>
> If at resume time, the load balancer directs the request to another
> upload-pack that generates this SHA-1 differently, ok this won't work
> (i.e. full pack is returned). In a busy repository, some refs may have
> moved so rev-list result at the resume time won't match any more, but
> we can deal with that later by relaxing to allow "want " lines with
> SHA-1 that are reachable from current refs, not just one of the refs
> (pack v4 or reachability bitmaps help).
> --
> Duy
-- 
Duy
Previous: Duy Nguyen
Message 8 of 8 in “Stalled git cloning and possible solutions”
  1. V.KrishnAug 29, 2013
  2. Jonathan NiederAug 29, 2013
  3. V.KrishnAug 29, 2013
  4. Junio C HamanoAug 29, 2013
  5. V.KrishnAug 29, 2013
  6. V.KrishnSep 4, 2013
  7. Duy NguyenAug 30, 2013
  8. Duy NguyenAug 30, 2013

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.