git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/3] Use ref transactions for fetch

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
May 5, 2014, 11:22 UTC
Message-ID
<53677483.4050409@alum.mit.edu>
In-Reply-To
<1398192327-21302-1-git-send-email-sahlberg@google.com>
On 04/22/2014 08:45 PM, Ronnie Sahlberg wrote:
Show 9 quoted lines
> This change is based on the previous ref transaction patches.
> This is sent as a separate patch series since it implements a lot more
> non-trivial changes to the behaviour than the previous patches and thus can
> use more detailed review.
> 
> Update fetch.c to use ref transactions when performing updates. Use a single
> ref transaction for all updates and only commit the transaction if all other
> checks and oeprations have been successful. This makes the ref updates during
> a fetch (mostly) atomic.

Is this always an improvement? What kind of checks are there that might fail?

It would be pretty annoying to spend a lot of time fetching a big pack, only to have the fetch fail because one reference out of many couldn't be updated. This would force the user to download the entire pack again, whereas if the successful reference updates had been allowed, then probably most or all of the second download would have been avoidable.

On the other hand, if a reference was renamed on the remote side, allowing a partial reference update could cause history to be discarded locally if the old name's delete was accepted but the new name's addition was rejected. This wouldn't be the end of the world, because the history is presumably still available remotely to fetch again, but it's not ideal either.

I'm not sure myself what I would prefer, but I wanted to point out that it is IMO not obvious that atomicity here is an improvement.

Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Ronnie SahlbergNext: Ronnie Sahlberg
Message 11 of 14 in “Use ref transactions for fetch”
  1. 0/3 Use ref transactions for fetchRonnie Sahlberg, Apr 22, 2014
  2. 1/3 fetch.c: clear errno before calling functions that might set itRonnie Sahlberg, Apr 22, 2014
  3. Eric SunshineApr 23, 2014
  4. Ronnie SahlbergApr 24, 2014
  5. 2/3 fetch.c: change s_update_ref to use a ref transactionRonnie Sahlberg, Apr 22, 2014
  6. Eric SunshineApr 23, 2014
  7. Ronnie SahlbergApr 24, 2014
  8. 3/3 fetch.c: use a single ref transaction for all ref updatesRonnie Sahlberg, Apr 22, 2014
  9. Eric SunshineApr 23, 2014
  10. Ronnie SahlbergApr 24, 2014
  11. Michael HaggertyMay 5, 2014
  12. Ronnie SahlbergMay 5, 2014
  13. Junio C HamanoMay 6, 2014
  14. Michael HaggertyMay 6, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.