From: Tarmigan <tarmigan+git@gmail.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
"H. Peter Anvin" <hpa@zytor.com>,
git@vger.kernel.org
Subject: Re: Git-aware HTTP transport
Date: Tue, 2 Sep 2008 11:20:31 -0700 [thread overview]
Message-ID: <905315640809021120j13ee5f5t21e1d2618b63568c@mail.gmail.com> (raw)
In-Reply-To: <20080902060608.GG13248@spearce.org>
On Mon, Sep 1, 2008 at 11:06 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
>> What does the server do after a 000cgive-up ? Does the server send
>> back a complete pack (like a new clone) or if not, how does clone work
>> over smart http?
>
> When the server receives a "give-up" it needs to create a pack
> based on "git rev-list --objects-boundary $WANT --not $COMMON".
> If the set $COMMON is non-empty then its a partial pack; if $COMMON
> is empty then its a full clone. This is what the native protocol
> does when the client gives up.
OK, that makes sense now.
>> Does that mean that if I fall more than 256 commits
>> behind, I have to redownload the whole repo?
>
> You are thinking the wrong way. If you have more than 256 commits
> that the other side doesn't have you may give up too early.
> For that to be true you need to create 256 commits locally that
> aren't on the remote peer and whose timestamps are all ahead of
> the commits you last fetched from the remote peer.
>
> Yes, it can happen. But its less likely than you think because
> we're talking about you doing 256 commits worth of development and
> not picking up any new commits from remote peers in the middle of
> that time period. Get just one and it resets the counter back to
> 0 and allows it to try another 256 commits before giving up.
>
> I should amend this section to talk about what giving up here
> really means. If we have nothing sent in common yet or maybe
> very little sent in common we may have existing remote refs tied
> to this URL in .git/config that can send, and we may have one or
> more annotated tags that we know for a fact are in common as both
> peers have the same tag name pointing to the same tag object.
>
> A smart(er) client might try to toss some recently dated annotated
> tags at the server before throwing a give-up if it would otherwise
> throw a give-up. Its likely to narrow the result set, and doesn't
> hurt if it doesn't.
Yes, throwing in tags and remotes as a last resort sounds like a good idea.
>> So again, if the client falls more than 1000 commits behind (not hard
>> to do for example during the linux merge window), and then the client
>> WANTs HEAD^1001, what happens? Does the get nothing from the server,
>> or does the client essentially reclone, or I am missing something?
>
> Oh, this is a live-lock condition. If the client grabs the list of
> refs from the server, then has to wait 100 ms to get back to the
> server and start upload-pack (due to latency) and in that 100ms
> window Linus shoves a 1001 commit merge into his tree then yes,
> the server may abort and tell the client "error invalid want".
Ahh, now I get it. Somehow I forgot that the WANTs were only boundary
commits and not a list of all the commits that the client wants.
On Mon, Sep 1, 2008 at 11:13 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> "H. Peter Anvin" <hpa@zytor.com> wrote:
>> Shawn O. Pearce wrote:
>>>
>>> Correct. Today _none_ of the transport protocols allow the server
>>> to force the client to use some sort of reference repository for an
>>> initial clone. There are likely two reasons for this:
>>>
>>> *) Its a lot simpler to program to just get everything from
>>> one location.
>>>
>>> *) If you really are forking an open source project then in
>>> some cases you may need to distribute the full source,
>>> not your delta. You may just as well distribute the full
>>> source and call it a day.
>>>
>>
>> 3) it encourages single points of failure.
>
> Or bad network usage, as I pointed out later about an India user
> unknowingly being forced into a US based mirror when another was
> closer to them.
>
> I didn't make it clear in my response but I'm really against our
> protocol having this sort of explicit redirect. I'd rather put a
> requirement in that says "Unless you have X,Y,Z in common with me
> (directly or indirectly) I'm just not going to give you a pack".
OK, this all makes sense. http:// and git:// are probably the wrong
protocols to reduce bandwidth for the server for new clones. Long
term, maybe gittorrent will be the right solution...
Thanks,
Tarmigan
next prev parent reply other threads:[~2008-09-02 18:31 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-26 1:26 Git-aware HTTP transport Shawn O. Pearce
2008-08-26 2:34 ` H. Peter Anvin
2008-08-26 3:45 ` Shawn O. Pearce
2008-08-26 3:59 ` david
2008-08-26 4:15 ` H. Peter Anvin
2008-08-26 4:25 ` david
2008-08-26 4:42 ` H. Peter Anvin
2008-08-26 4:45 ` Imran M Yousuf
2008-08-26 17:01 ` Nicolas Pitre
2008-08-26 17:03 ` Shawn O. Pearce
2008-08-26 4:14 ` H. Peter Anvin
2008-08-26 14:58 ` Shawn O. Pearce
2008-08-26 16:14 ` Shawn O. Pearce
2008-08-26 16:33 ` H. Peter Anvin
2008-08-26 17:26 ` Shawn O. Pearce
2008-08-26 22:38 ` H. Peter Anvin
2008-08-27 2:51 ` Imran M Yousuf
2008-08-28 3:50 ` Shawn O. Pearce
2008-08-28 4:37 ` H. Peter Anvin
2008-08-28 4:42 ` Shawn O. Pearce
2008-08-28 4:58 ` H. Peter Anvin
2008-08-28 6:40 ` Imran M Yousuf
2008-08-28 4:42 ` Junio C Hamano
2008-08-28 14:57 ` Shawn O. Pearce
2008-08-28 17:26 ` david
2008-08-28 17:28 ` Shawn O. Pearce
2008-08-28 17:37 ` david
2008-08-28 17:38 ` Daniel Stenberg
2008-08-28 17:43 ` Shawn O. Pearce
2008-08-28 17:47 ` H. Peter Anvin
2008-08-28 18:04 ` Mike Hommey
2008-08-28 17:43 ` H. Peter Anvin
2008-08-28 18:12 ` david
2008-08-28 18:14 ` H. Peter Anvin
2008-08-28 18:18 ` david
2008-08-29 4:02 ` Junio C Hamano
2008-08-29 5:11 ` H. Peter Anvin
2008-08-29 6:50 ` Junio C Hamano
2008-08-29 17:39 ` Shawn O. Pearce
2008-08-29 19:55 ` Nicolas Pitre
2008-09-01 16:05 ` Tarmigan
2008-09-01 16:13 ` Tarmigan
2008-09-02 6:06 ` Shawn O. Pearce
2008-09-02 6:09 ` H. Peter Anvin
2008-09-02 6:13 ` Shawn O. Pearce
2008-09-02 18:20 ` Tarmigan [this message]
2008-08-28 17:05 ` H. Peter Anvin
2008-08-28 17:10 ` Shawn O. Pearce
2008-08-28 17:20 ` H. Peter Anvin
2008-08-28 17:26 ` Shawn O. Pearce
2008-08-28 17:44 ` H. Peter Anvin
2008-08-28 17:46 ` Shawn O. Pearce
2008-08-28 18:40 ` Nicolas Pitre
2008-08-28 18:47 ` H. Peter Anvin
2013-02-13 1:34 ` Git-aware HTTP transport docs H. Peter Anvin
2013-02-13 2:23 ` Scott Chacon
2013-02-13 15:29 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=905315640809021120j13ee5f5t21e1d2618b63568c@mail.gmail.com \
--to=tarmigan+git@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hpa@zytor.com \
--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.
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 NNTP newsgroup(s).