From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>,
git@vger.kernel.org, Patrick Ohly <patrick.ohly@intel.com>
Subject: Re: [PATCH 2/2] odb/source-loose: fix existence checks for newly written objects
Date: Mon, 9 Nov 2026 14:44:46 +0100 [thread overview]
Message-ID: <avHOTt_PEJUKq9Dy@pks.im> (raw)
In-Reply-To: <xmqq5wyalzi2.fsf@gitster.g>
On Fri, Nov 06, 2026 at 08:02:13AM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
>
> > On Thu, Nov 05, 2026 at 02:43:14PM -0500, Jeff King wrote:
> >> On Wed, Nov 04, 2026 at 01:16:35PM +0100, Patrick Steinhardt wrote:
> >> ...
> >> So I kind of wonder if prefetch_cache_entries(), along with any caller
> >> doing an OBJECT_INFO_FOR_PREFETCH check, ought to omit the QUICK flag.
> >> It would mean that the normal case of having missing partial objects
> >> (about to be fetched) would cause us to re-scan the local pack list, but
> >> that's not _that_ expensive, especially compared to the fetch we're
> >> about to do.
> >
> > Yeah, that's a valid point. Honestly, by now I'm almost urged to just
> > drop the QUICK flag altogther. It's a source of bugs, and the longer we
> > look at it the more cases we find where the existing users thereof are
> > buggy in specific edge cases. We just recently removed one user of
> > QUICK, and this here is another dubious case. I wouldn't be surprised if
> > we could find edge cases for the other, remaining users, as well.
> > ...
> >> > We could in theory fix this by flushing all the loose object caches
> >> > again, like we used to do before 5946a564cdd. But that wouldn't address
> >> > the root cause: the cache would still be stale unless somebody does a
> >> > non-QUICK read for a missing object. Instead, fix the bug by updating
> >> > the cache whenever we write a new loose object.
>
> OK. At least this change hides this specific failure mode. Can we
> include some documentation that we may want to rethink the "QUICK"
> thing and audit its current uses (if we decide to keep it, that is)
> and move on with this change?
>
>
> odb.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git c/odb.h w/odb.h
> index dd85b880a7..61ff443d46 100644
> --- c/odb.h
> +++ w/odb.h
> @@ -386,6 +386,9 @@ enum object_info_flags {
> /*
> * This is meant for bulk prefetching of missing blobs in a partial
> * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK.
> + *
> + * NEEDSWORK: rethink if QUICK is desired in this context.
> + * cf. <au23Hvzp09yrym9s@pks.im>
> */
> OBJECT_INFO_FOR_PREFETCH = (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK),
> };
Yeah, that'd probably be sensible. But I wonder whether that comment
should rather be applied to `OBJECT_INFO_QUICK` itself, as I think it's
way too much of a foot gun and I'm not sure whether it's ever really
sensible to use. But I'm fine with either variant.
Will you squash that in or shall I send a new version?
Thanks!
Patrick
next prev parent reply other threads:[~2026-11-09 13:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 12:16 [PATCH 0/2] odb/source-loose: fix failing existence checks caused by stale cache Patrick Steinhardt
2026-11-04 12:16 ` [PATCH 1/2] odb/source-loose: extract logic to retrieve subdirectory bitmap Patrick Steinhardt
2026-11-04 12:16 ` [PATCH 2/2] odb/source-loose: fix existence checks for newly written objects Patrick Steinhardt
2026-11-04 17:47 ` Junio C Hamano
2026-11-05 19:43 ` Jeff King
2026-11-06 11:16 ` Patrick Steinhardt
2026-11-06 16:02 ` Junio C Hamano
2026-11-09 13:44 ` Patrick Steinhardt [this message]
2026-11-09 18:50 ` Jeff King
2026-11-04 12:57 ` [PATCH 0/2] odb/source-loose: fix failing existence checks caused by stale cache Kristofer Karlsson
2026-11-04 16:27 ` Derrick Stolee
2026-11-05 0:09 ` 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=avHOTt_PEJUKq9Dy@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=patrick.ohly@intel.com \
--cc=peff@peff.net \
/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