From: Karthik Nayak Date: Thu, 22 Oct 2026 09:13:57 GMT Subject: Re: [PATCH v3] fetch: commit references fetched before backfilling tags Message-ID: In-Reply-To: Justin Tobler writes: > On 26/10/21 06:01AM, Karthik Nayak wrote: >> Patrick Steinhardt writes: >> > On Tue, Oct 20, 2026 at 06:05:22PM -0500, Justin Tobler wrote: >> >> Naively, I think it would be nice if it were possible supplement the >> >> backfill fetch "haves" with the non-committed references in the pending >> >> transaction directly. That would avoid having to commit the references >> >> in the middle and probably also fix it for atomic fetches too, but I'm >> >> uncertain if that would be a simple or reasonable thing to do. >> > >> > Hmm, I think that's a sensible idea. We should know about the ref >> > updates we have already scheduled into the transaction, so in theory we >> > could use their new object IDs in the negotiation. If that's possible it >> > would definitely be a much better fix. >> >> I'm a bit wary of going down ad we'd be exposing un-committed references >> which could fail as 'haves' to the server. This doesn't seem to be >> conceptually correct as we now expect GC to not clear the objects needed >> by relying on the .keep lock instead of durable references. > > I'm not quite sure I follow why this would be conceptually problematic. > Should it really matter in this particular scenario whether the tips the > client advertises are committed or not? The required objects should > already be present in the repository from the initial fetch. > > Regarding the continued use of ".keep" lockfiles to prevent newly > fetched packfiles from being GC'd, that still sounds reasonable to me. > It is expected that the ".keep" lockfiles remain in place until the > reference transaction is committed any way. To me, conceptually all we > are doing is allowing the current inflight state of the transaction to > be used to affect another operation being performed within the very same > transaction. > I was getting at it from the point that '.keep' lockfiles are created for the reference transaction to commit. So while they keep the objects in place, we should only rely on a committed reference to keep objects in place. But, you're right, the transaction here keeps the lockfiles in place until we commit anyways. So I guess that's okay. Let me send in a new version and we can see what everyone thinks. Thanks! >> But seems like we have negotiation_include_tips in the transport >> structure which seems like the right fit? > > At a quick glance, this seems like it could be a good way for the client > to advertise to the sever the tips of the uncommitted references it has. > > -Justin