git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>, Jeff King <peff@peff.net>,
	spearce@spearce.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: Is anyone working on a next-gen Git protocol?
Date: Mon, 08 Oct 2012 11:05:01 +0200	[thread overview]
Message-ID: <5072973D.4080703@op5.se> (raw)
In-Reply-To: <CACBZZX6b+3P8M+z+X13k9Pq3tvVUfs_k1=foQVreX8K801=efQ@mail.gmail.com>

On 10/07/2012 09:57 PM, Ævar Arnfjörð Bjarmason wrote:
> On Wed, Oct 3, 2012 at 9:13 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>>
>>> I'm creating a system where a lot of remotes constantly fetch from a
>>> central repository for deployment purposes, but I've noticed that even
>>> with a remote.$name.fetch configuration to only get certain refs a
>>> "git fetch" will still call git-upload pack which will provide a list
>>> of all references.
>>
>> It has been observed that the sender has to advertise megabytes of
>> refs because it has to speak first before knowing what the receiver
>> wants, even when the receiver is interested in getting updates from
>> only one of them, or worse yet, when the receiver is only trying to
>> peek the ref it is interested has been updated.
> 
> Has anyone started working on a next-gen Git protocol as a result of
> this discussion? If not I thought I'd give it a shot if/when I have
> time.
> 
> The current protocol is basically (S = Server, C = Client)
> 
>   S: Spew out first ref
>   S: Advertisement of capabilities
>   S: Dump of all our refs
>   C/S: Declare wanted refs, negotiate with server
>   S: Send pack to client, if needed
> 
> And I thought I'd basically turn it into:
> 
>   C: Connect to server, declare what protocol we understand
>   C: Advertisement of capabilities
>   S: Advertisement of capabilities
>   C/S: Negotiate what we want
>   C/S: Same as v1, without the advertisement of capabilities, and maybe
> don't dump refs at all
> 
> Basically future-proofing it by having the client say what it supports
> to begin with along with what it can handle (like in HTTP).
> 
> Then in the negotiation phase the client & server would go back &
> forth about what they want & how they want it. I'd planned to
> implement something like:
> 
>      C: want_refs refs/heads/*
>      S: OK to that
>      C: want_refs refs/tags/*
>      S: OK to that
> 
> Or:
> 
>      C: want_refs refs/heads/master
>      S: OK to that
>      C: want_refs refs/tags/v*
>      S: OK to that
> 

You'll want that to be a single "wants" message to avoid incurring
insane amounts of roundtrip latency with lots of refs. github and
other hosted services are quite popular, but with my 120ms ping
rtt I'd be spending half a minute just telling the other side what
I want when I fetch from a repo with 250 refs.

It's a flagday and a half to change the protocol though, so I expect
it'll have to wait for 2.0, unless the current client-side part of
it is dumb and ignores existing refs when requesting its "wants", in
which case the server can just stop advertising existing refs and
most of the speedup is already done.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

  parent reply	other threads:[~2012-10-08  9:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-07 19:57 Is anyone working on a next-gen Git protocol? Ævar Arnfjörð Bjarmason
2012-10-07 20:22 ` Ilari Liusvaara
2012-10-07 22:08 ` Jeff King
2012-10-07 22:31 ` Junio C Hamano
2012-10-22  4:59   ` Junio C Hamano
2012-10-08  9:05 ` Andreas Ericsson [this message]
2012-10-08 16:27   ` Junio C Hamano
2012-10-10 19:13     ` Steffen Prohaska
2012-10-10 20:46       ` Junio C Hamano
2012-10-10 22:32         ` Philip Oakley
2012-10-11  1:44         ` Nguyen Thai Ngoc Duy
2012-10-11  3:08           ` Shawn Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5072973D.4080703@op5.se \
    --to=ae@op5.se \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).