From: Jonathan Tan <jonathantanmy@google.com>
To: git@vger.kernel.org
Cc: Jonathan Tan <jonathantanmy@google.com>
Subject: [PATCH v2 0/2] Fail early when partial clone prefetch fails
Date: Tue, 4 Oct 2022 14:13:39 -0700 [thread overview]
Message-ID: <cover.1664917853.git.jonathantanmy@google.com> (raw)
In-Reply-To: <cover.1664316642.git.jonathantanmy@google.com>
Thanks everyone for your comments. I don't think that there is a test
for when a lazy fetch fails, for some reason, so I added one.
Jonathan Tan (2):
promisor-remote: remove a return value
promisor-remote: die upon failing fetch
object-file.c | 4 ----
promisor-remote.c | 23 ++++++++++++++---------
promisor-remote.h | 11 +++++------
t/t0410-partial-clone.sh | 14 ++++++++++++++
4 files changed, 33 insertions(+), 19 deletions(-)
Range-diff against v1:
1: fdb35bc9a6 ! 1: 207332c2df promisor-remote: remove a return value
@@ Commit message
No caller of promisor_remote_get_direct() is checking its return value,
so remove it.
+ Not checking the return value means that the user would not know
+ whether the failure of reading an object is due to the promisor remote
+ not supplying the object or because of local repository corruption, but
+ this will be fixed in a subsequent patch.
+
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2: 06a649b01a ! 2: 9bbf130c2c promisor-remote: die upon failing fetch
@@ Commit message
When this batch prefetch fails, these commands fall back to the
sequential fetches. But at $DAYJOB we have noticed that this results in
a bad user experience: a command would take unexpectedly long to finish
- if the batch prefetch would fail for some intermittent reason, but all
- subsequent fetches would work. It would be a better user experience for
- such a command would just fail.
+ (and possibly use up a lot of bandwidth) if the batch prefetch would
+ fail for some intermittent reason, but all subsequent fetches would
+ work. It would be a better user experience for such a command would
+ just fail.
Therefore, make it a fatal error if the prefetch fails and at least one
object being fetched is known to be a promisor object. (The latter
@@ promisor-remote.c: void promisor_remote_get_direct(struct repository *repo,
if (to_free)
free(remaining_oids);
}
+
+ ## t/t0410-partial-clone.sh ##
+@@ t/t0410-partial-clone.sh: test_expect_success 'fetching of missing objects' '
+ grep "$HASH" out
+ '
+
++test_expect_success 'fetching of a promised object that promisor remote no longer has' '
++ rm -f err &&
++ test_create_repo unreliable-server &&
++ git -C unreliable-server config uploadpack.allowanysha1inwant 1 &&
++ git -C unreliable-server config uploadpack.allowfilter 1 &&
++ test_commit -C unreliable-server foo &&
++
++ git clone --filter=blob:none --no-checkout "file://$(pwd)/unreliable-server" unreliable-client &&
++
++ rm -rf unreliable-server/.git/objects/* &&
++ test_must_fail git -C unreliable-client checkout HEAD 2>err &&
++ grep "could not fetch.*from promisor remote" err
++'
++
+ test_expect_success 'fetching of missing objects works with ref-in-want enabled' '
+ # ref-in-want requires protocol version 2
+ git -C server config protocol.version 2 &&
--
2.38.0.rc1.362.ged0d419d3c-goog
next prev parent reply other threads:[~2022-10-04 21:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 22:12 [PATCH 0/2] Fail early when partial clone prefetch fails Jonathan Tan
2022-09-27 22:12 ` [PATCH 1/2] promisor-remote: remove a return value Jonathan Tan
2022-09-29 19:23 ` Junio C Hamano
2022-09-30 22:02 ` Jonathan Tan
2022-09-27 22:12 ` [PATCH 2/2] promisor-remote: die upon failing fetch Jonathan Tan
2022-09-28 17:43 ` Glen Choo
2022-09-30 22:10 ` Jonathan Tan
2022-09-29 20:14 ` Junio C Hamano
2022-09-29 20:15 ` [PATCH 0/2] Fail early when partial clone prefetch fails Junio C Hamano
2022-09-30 21:50 ` Jonathan Tan
2022-09-30 22:17 ` Junio C Hamano
2022-10-04 21:13 ` Jonathan Tan [this message]
2022-10-04 21:13 ` [PATCH v2 1/2] promisor-remote: remove a return value Jonathan Tan
2022-10-04 21:13 ` [PATCH v2 2/2] promisor-remote: die upon failing fetch Jonathan Tan
2022-10-05 18:09 ` [PATCH v2 0/2] Fail early when partial clone prefetch fails 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
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=cover.1664917853.git.jonathantanmy@google.com \
--to=jonathantanmy@google.com \
--cc=git@vger.kernel.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).