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

Re: Resumable clone/Gittorrent (again) - stable packs?

From
Sam Vilain <sam@vilain.net>
Date
Jan 10, 2011, 21:07 UTC
Message-ID
<4D2B7522.9050400@vilain.net>
In-Reply-To
<20110107185218.GA16645@LK-Perkele-VI.localdomain>
On 08/01/11 07:52, Ilari Liusvaara wrote:
Show 12 quoted lines
> Ability to contact multiple servers in sequence, each time advertising
> everything obtained so far. Then treat the new repo as clone of the last
> address.
>
> This would e.g. be very handy if you happen to have local mirror of say, Linux
> kernel and want to fetch some related project without messing with alternates
> or downloading everything again:
>
> git clone --use-mirror=~/repositories/linux-2.6 git://foo.example/linux-foo
>
> This would first fetch everything from local source and then update that
> from remote, likely being vastly faster.

Coming to this discussion a little late, I'll summarise the previous research.

First, the idea of applying the straight BitTorrent protocol to the pack files was raised, but as Nicolas mentions, this is not useful because the pack files are not deterministic. The protocol was revisited based around the part which is stable, object manifests. The RFC is at http://utsl.gen.nz/gittorrent/rfc.html and the prototype code (an unsuccessful GSoC project) is at http://repo.or.cz/w/VCS-Git-Torrent.git

After some thought, I decided that the BitTorrent protocol itself is all cruft and that trying to cut it down to be useful was a waste of time. So, this is where the idea of "automatic mirroring" came from. With Automatic Mirroring, the two main functions of P2P operation - peer discovery and partial transfer - are broken into discrete features.

I wrote this patch series so far, for "client-side mirroring":
http://thread.gmane.org/gmane.comp.version-control.git/133626/focus=133628
The later levels are roughly discussed on this page:
http://code.google.com/p/gittorrent/wiki/MirrorSync

The "mirror sync" part is the complicated one, and as others have noted no truly successful prototype has yet been built. Actually the Perl gittorrent implementation did manage to perform an incremental clone; it just didn't wrap it up nicely. But I won't go into that too much. There was also another GSoC program to look at caching the object list generation, the most expensive part of the process in the Perl implementation. This was a generic mechanism for accelerating object graph traversal and showed promise, however unfortunately was never merged.

The client-side mirroring patch, in its current form, already supports out-of-date mirrors. It saves refs first into 'refs/mirrors/hostname/...' and finally contacts the main server to check what objects it is still missing. So, if there was a regular bittorrent+bundle transport available, it would be a useful way to support an incremental clone; the client would first clone the (static) bittorrent bundle, unpack it with its refs into the 'refs/mirrors/xxx/' namespace, making the subsequent 'git fetch' to get the most recent objects a much more efficient operation.

Hope that helps!

Cheers, Sam

Previous: Jeff KingNext: Nguyen Thai Ngoc Duy
Message 20 of 22 in “Re: Resumable clone/Gittorrent (again) - stable packs?”
  1. Zenaan HarknessJan 6, 2011
  2. Shawn PearceJan 6, 2011
  3. John WyzerJan 10, 2011
  4. Sam VilainJan 10, 2011
  5. Nguyen Thai Ngoc DuyJan 11, 2011
  6. J.H.Jan 11, 2011
  7. Nguyen Thai Ngoc DuyJan 11, 2011
  8. Nicolas PitreJan 6, 2011
  9. Zenaan HarknessJan 7, 2011
  10. Nicolas PitreJan 7, 2011
  11. Jeff KingJan 7, 2011
  12. Jeff KingJan 7, 2011
  13. Zenaan HarknessJan 7, 2011
  14. Ilari LiusvaaraJan 7, 2011
  15. Jeff KingJan 7, 2011
  16. Ilari LiusvaaraJan 7, 2011
  17. Jeff KingJan 7, 2011
  18. Ilari LiusvaaraJan 7, 2011
  19. Jeff KingJan 7, 2011
  20. Sam VilainJan 10, 2011
  21. Nguyen Thai Ngoc DuyJan 10, 2011
  22. Nicolas PitreJan 10, 2011

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.