git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Daniel Barkalow <barkalow@iabervon.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Nicolas Pitre <nico@cam.org>, Len Brown <lenb@kernel.org>,
	Theodore Tso <tytso@mit.edu>,
	git@vger.kernel.org
Subject: Re: warning: no common commits - slow pull
Date: Thu, 28 Feb 2008 10:53:18 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.1.00.0802281026030.19665@iabervon.org> (raw)
In-Reply-To: <7voda1nbzc.fsf@gitster.siamese.dyndns.org>

On Wed, 27 Feb 2008, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > On Wed, 27 Feb 2008, Junio C Hamano wrote:
> >
> >> Daniel Barkalow <barkalow@iabervon.org> writes:
> >> 
> >> > Correcting the transport code is important (and should
> >> > probably be done...
> 
> I thought about discarding the cached refs upon disconnect, but didn't do
> that, because presumably a caller might want to:
> 
>     transport_get_remote_refs() to find what they have
>     decide what it wants
>     transport_fetch_refs() to ask for them
>     do stuff about the refs obtained
>     transport_disconnect() to finish the transfer
>     still do stuff about the refs obtained
> 
> and such a change would forbid the last step.  But the only reason I
> avoided to break such a potential caller was because I did not bother to
> check if such a caller exists, and not because I thought the above
> sequence is sane, so if you think it is saner to clean up the stale
> information upon disconnect, please do so.

Actually, I just realized something which should have been obvious: when 
we reconnect, we get a list of the remote's refs, which we currently 
discard immediately. We should actually pass this list to fetch_pack() if 
we just reconnected, so that the client side always does the interaction 
with the right idea of the server's refs, and discard it afterwards. The 
fact that the user of transport_*() doesn't find out that the server 
side's refs change in the middle of the life cycle and can't find out in 
any way doesn't matter too much, so long as each actual connection is 
internally consistant. (And the situation is no different from how it used 
to be with git-fetch.sh: if you get a different mirror later, you may 
discover that the server now doesn't have refs that it seemed to 
advertize, but nothing weird happens.)

> >> You won't know if you need only one object, so seeing that you
> >> have T^{} and asking _only_ for T is _wrong_.  Think of a tag
> >> that points at another tag that points at the commit.  You need
> >> to tell the other end "I have T^{}, please give me T", and that
> >> is exactly what the autofollowing does.
> >
> > I don't see that. If the situation is:
> >
> >       T - tag     master
> >      /           /
> > O - A - O - O - B
> > ...
> > The issue is that our starting set for our side of the negotiation is our 
> > current refs, which doesn't include A. I'm suggesting that, for the 
> > purposes of autofollow, A should be included.
> 
> By telling the other end that we have B, we are implicitly telling that we
> have A as well.  Under normal situation, telling the other end we have A
> does not help nor hurt anything.

I think it could be slightly less server load if it doesn't have to walk 
from B to A, and I could make up something about cache locality.

> Under abnormal situation (e.g. DNS round
> robin switching the other end in the middle), the other end may say "I
> dunno about B", but the protocol is designed to negotiate and find that
> both ends have A, by following the ancestry chain down, so I do not think
> telling the other end that we have A helps that much.

I remember your tests that didn't quite show the problem leading to the 
autofollow connection getting ~100 objects, which is better than 700000 
but worse than the correct 1 for that case; I think it had found a commit 
commit not too far away, but not the perfect one.

> I however think
> that such a change would help sweeping potential bugs under the rug by
> making them harder to trigger.
> 
> By the way, the situation I said your logic would break is this:
> 
>     ---o---A---o---o---B
>             \
>              T---S
> 
> Both T and S are annotated tags, pointing at A and T respectively, and
> they both peel to A.  As long as you ask for both T and S you may be Ok,
> but it feels still wrong.  Commit walkers may grab S, die before grabbing
> T (git-native protocol is atomic with respect to objects transfer, so it
> won't have such an issue).

They wouldn't write a ref for S, though, so the result would be consistant 
still. If you ask for T and S and say you have A, everything should work.

	-Daniel
*This .sig left intentionally blank*

  reply	other threads:[~2008-02-28 15:54 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-11  1:07 warning: no common commits - slow pull Len Brown
2008-02-11  1:44 ` Junio C Hamano
2008-02-17  3:52   ` Daniel Barkalow
2008-02-17 14:57     ` Johannes Schindelin
2008-02-17 17:46       ` Daniel Barkalow
2008-02-17 17:54       ` Junio C Hamano
2008-02-17 19:27         ` Johannes Schindelin
2008-02-17 20:41           ` Daniel Barkalow
2008-02-11  1:53 ` Theodore Tso
2008-02-11  2:39   ` Len Brown
2008-02-11  2:49   ` Junio C Hamano
2008-02-11  3:55     ` Theodore Tso
2008-02-15 21:43       ` Len Brown
2008-02-16 21:22         ` Johannes Schindelin
2008-02-25 21:59         ` Florian Weimer
2008-02-25 23:32           ` Daniel Barkalow
2008-02-26 19:38         ` Len Brown
2008-02-26 20:47           ` Nicolas Pitre
2008-02-26 23:45           ` Daniel Barkalow
2008-02-27  5:12           ` Junio C Hamano
2008-02-27  6:29             ` Junio C Hamano
2008-02-27 19:28               ` Daniel Barkalow
2008-02-27 20:53                 ` Junio C Hamano
2008-02-27 21:26                   ` Daniel Barkalow
2008-02-28  0:43                     ` Shawn O. Pearce
2008-02-28  8:50                       ` Shawn O. Pearce
2008-02-29 14:44                         ` Jon Loeliger
2008-02-29 17:14                           ` Daniel Barkalow
2008-02-28  0:47                     ` Junio C Hamano
2008-02-28 15:53                       ` Daniel Barkalow [this message]
2008-02-28 16:10                         ` [PATCH] Always use the current connection's remote ref list in git protocol Daniel Barkalow
2008-02-28 17:52                         ` warning: no common commits - slow pull Junio C Hamano
2008-02-28 18:36                           ` Daniel Barkalow
2008-02-11 15:54 ` Florian Weimer
2008-02-11 21:13   ` Nix
  -- strict thread matches above, loose matches on Subject: below --
2008-03-07  1:35 David Brownell
2008-03-08  1:22 ` Daniel Barkalow
2008-03-08 22:48   ` David Brownell
2008-03-08 22:58     ` Daniel Barkalow
2008-03-08 23:25       ` David Brownell
2008-03-08 23:27         ` Daniel Barkalow
2008-03-09 18:47           ` Daniel Barkalow
2008-03-10 17:18             ` David Brownell
2008-03-10 17:40               ` Daniel Barkalow

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=alpine.LNX.1.00.0802281026030.19665@iabervon.org \
    --to=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lenb@kernel.org \
    --cc=nico@cam.org \
    --cc=tytso@mit.edu \
    /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).