Files
git/builtin
Jonathan Tan 8a30a1efd1 index-pack: prefetch missing REF_DELTA bases
When fetching, the client sends "have" commit IDs indicating that the
server does not need to send any object referenced by those commits,
reducing network I/O. When the client is a partial clone, the client
still sends "have"s in this way, even if it does not have every object
referenced by a commit it sent as "have".

If a server omits such an object, it is fine: the client could lazily
fetch that object before this fetch, and it can still do so after.

The issue is when the server sends a thin pack containing an object that
is a REF_DELTA against such a missing object: index-pack fails to fix
the thin pack. When support for lazily fetching missing objects was
added in 8b4c0103a9 ("sha1_file: support lazily fetching missing
objects", 2017-12-08), support in index-pack was turned off in the
belief that it accesses the repo only to do hash collision checks.
However, this is not true: it also needs to access the repo to resolve
REF_DELTA bases.

Support for lazy fetching should still generally be turned off in
index-pack because it is used as part of the lazy fetching process
itself (if not, infinite loops may occur), but we do need to fetch the
REF_DELTA bases. (When fetching REF_DELTA bases, it is unlikely that
those are REF_DELTA themselves, because we do not send "have" when
making such fetches.)

To resolve this, prefetch all missing REF_DELTA bases before attempting
to resolve them. This both ensures that all bases are attempted to be
fetched, and ensures that we make only one request per index-pack
invocation, and not one request per missing object.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-15 11:01:40 +09:00
..
2019-04-25 16:41:17 +09:00
2019-04-25 16:41:14 +09:00
2018-05-13 10:45:05 +09:00
2019-01-29 12:47:54 -08:00
2019-04-25 16:41:12 +09:00
2018-10-19 13:34:02 +09:00
2019-03-20 15:16:06 +09:00
2019-04-01 12:51:51 +09:00
2019-02-06 22:05:23 -08:00
2019-02-06 22:05:23 -08:00
2019-01-18 13:49:52 -08:00
2019-03-24 21:35:34 +09:00
2019-05-13 23:50:34 +09:00
2019-05-09 00:37:25 +09:00
2018-05-29 00:28:22 +09:00