Re: [PATCH 2/2] fetch: implement support for atomic reference updates
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 8, 2021, 00:19 UTC
- Message-ID
- <xmqqeeiwjn52.fsf@gitster.c.googlers.com>
- In-Reply-To
- <4807344e92bedbac37243434850da1f0787ad496.1610027375.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 13 quoted lines
> Similar to `git push --atomic`, this commit thus introduces atomic > fetches. Instead of allocating one reference transaction per updated > reference, it causes us to only allocate a single transaction and commit > it as soon as all updates were received. If locking of any reference > fails, then we abort the complete transaction and don't update any > reference, which gives us an all-or-nothing fetch. > > Note that this may not completely fix the first of above downsides, as > the consistent view also depends on the server-side. If the server > doesn't have a consistent view of its own references during the > reference negotiation phase, then the client would get the same > inconsistent view the server has. This is a separate problem though and, > if it actually exists, can be fixed at a later point.
With the help of the previous step, it is trivial to see that the single transaction around store_updated_refs() would be sufficient to achieve the atomicity.
But what about FETCH_HEAD? Do we refrain from writing and/or appending to it when there is any failure?
Thanks.