Subject: Re: [PATCH v4 08/11] bundle: add flags to verify_bundle(), skip walk

From: Junio C Hamano <[email-masked]>
Date: Mon, 10 Oct 2022 11:40:20 -0700

Derrick Stolee <[email-masked]> writes:

> I've been going over the refs code multiple times today trying to
> fix this "real" culprit, with no luck. I can share this interesting
> point:
>
>  * The initial loop over the bundles tries to apply each, but the
>    prerequisite objects are not present so we never reach the revision
>    walk. A refs/bundle/* ref is added via update_ref().
>
>  * The second loop over the bundles tries to apply each, but the only
>    bundle with its prerequisites present also finds the commits as
>    reachable (this must be where the loose ref cache is populated).
>    Then, a refs/bundle/* ref is added via update_ref().
>
>  * The third loop over the bundles finds a bundle whose prerequisites
>    are present, but verify_bundle() rejected it because those commits
>    were not seen from any ref.
>
> Other than identifying that issue, I was unable to track down exactly
> what is happening here or offer a fix. I had considered inserting
> more cache frees deep in the refs code, but I wasn't sure what effect
> that would have across the wider system.

OK.  That certainly is understandable.

As a comment in the proposed log message that BUNDLE_SKIP_REACHABLE
bit is a band aid papering over a problem we punted in this series,
to guide future developers, I think what you wrote is sufficient.
We do not want them to think that skipping the check is our
preferred longer term solution and add their own hack to keep
skipping the check when they resolve "the real culprit".

Thanks.