From: Josh Triplett <josh@joshtriplett.org>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Stefan Beller <sbeller@google.com>,
"git@vger.kernel.org" <git@vger.kernel.org>,
sarah@thesharps.us
Subject: Re: Resumable git clone?
Date: Wed, 2 Mar 2016 08:40:06 -0800 [thread overview]
Message-ID: <20160302164006.GA13790@x> (raw)
In-Reply-To: <CACsJy8CBBk4bgz6Gn0QvCwWtOsqcQZBYgOBQTd=4Y+2YKs44Qg@mail.gmail.com>
On Wed, Mar 02, 2016 at 03:22:17PM +0700, Duy Nguyen wrote:
> On Wed, Mar 2, 2016 at 3:13 PM, Josh Triplett <josh@joshtriplett.org> wrote:
> > On Wed, Mar 02, 2016 at 02:30:24AM +0000, Al Viro wrote:
> >> On Tue, Mar 01, 2016 at 05:40:28PM -0800, Stefan Beller wrote:
> >>
> >> > So throwing away half finished stuff while keeping the front load?
> >>
> >> Throw away the object that got truncated and ones for which delta chain
> >> doesn't resolve entirely in the transferred part.
> >>
> >> > > indexing the objects it
> >> > > contains, and then re-running clone and not having to fetch those
> >> > > objects.
> >> >
> >> > The pack is not deterministic for a given repository. When creating
> >> > the pack, you may encounter races between threads, such that the order
> >> > in a pack differs.
> >>
> >> FWIW, I wasn't proposing to recreate the remaining bits of that _pack_;
> >> just do the normal pull with one addition: start with sending the list
> >> of sha1 of objects you are about to send and let the recepient reply
> >> with "I already have <set of sha1>, don't bother with those". And exclude
> >> those from the transfer. Encoding for the set being available is an
> >> interesting variable here - might be plain list of sha1, might be its
> >> complement ("I want the following subset"), might be "145th to 1029th,
> >> 1517th and 1890th to 1920th of the list you've sent"; which form ends
> >> up more efficient needs to be found experimentally...
> >
> > As a simple proposal, the server could send the list of hashes (in
> > approximately the same order it would send the pack), the client could
> > send back a bitmap where '0' means "send it" and '1' means "got that one
> > already", and the client could compress that bitmap. That gives you the
> > RLE and similar without having to write it yourself. That might not be
> > optimal, but it would likely set a high bar with minimal effort.
>
> We have an implementation of EWAH bitmap compression, so compressing
> is not a problem.
>
> But I still don't see why it's more efficient to have the server send
> the hash list to the client. Assume you need to transfer N objects.
> That direction makes you always send N hashes. But if the client sends
> the list of already fetched objects, M, then M <= N. And we won't need
> to send the bitmap. What did I miss?
M can potentially be larger than N if you have many remotes and branches
in your local repository that the server doesn't have. However, that
certainly wouldn't be the common case, and in that case heuristics on
the client side could help there in determining a subset to send.
I can't think of any good argument for the server's hash list; a
client-sent list does seem reasonable.
- Josh Triplett
next prev parent reply other threads:[~2016-03-02 16:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 1:30 Resumable git clone? Josh Triplett
2016-03-02 1:40 ` Stefan Beller
2016-03-02 2:30 ` Al Viro
2016-03-02 6:31 ` Junio C Hamano
2016-03-02 7:37 ` Duy Nguyen
2016-03-02 7:44 ` Duy Nguyen
2016-03-02 7:54 ` Josh Triplett
2016-03-02 8:31 ` Junio C Hamano
2016-03-02 9:28 ` Duy Nguyen
2016-03-02 16:41 ` Josh Triplett
2016-03-02 8:13 ` Josh Triplett
2016-03-02 8:22 ` Duy Nguyen
2016-03-02 8:32 ` Jeff King
2016-03-02 10:47 ` Bhavik Bavishi
2016-03-02 16:40 ` Josh Triplett [this message]
2016-03-02 8:14 ` Duy Nguyen
2016-03-02 1:45 ` Duy Nguyen
2016-03-02 8:41 ` Junio C Hamano
2016-03-02 15:51 ` Konstantin Ryabitsev
2016-03-02 16:49 ` Josh Triplett
2016-03-02 17:57 ` Junio C Hamano
2016-03-24 8:00 ` Philip Oakley
2016-03-24 15:53 ` Junio C Hamano
2016-03-24 21:08 ` Philip Oakley
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=20160302164006.GA13790@x \
--to=josh@joshtriplett.org \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=sarah@thesharps.us \
--cc=sbeller@google.com \
--cc=viro@zeniv.linux.org.uk \
/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).