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

Re: reducing prune sync()s

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
May 30, 2008, 02:30 UTC
Message-ID
<alpine.LFD.1.10.0805291923030.3141@woody.linux-foundation.org>
In-Reply-To
<alpine.LFD.1.10.0805291905360.3141@woody.linux-foundation.org>
On Thu, 29 May 2008, Linus Torvalds wrote:
Show 9 quoted lines
> 
> So if you have a system crash at a really bad time, you may have a git 
> repository that needs manual intervention to actually be *usable*. I hope 
> nobody ever believed anything else. That manual intervention may be things 
> like:
> ...
>  - actually throw away broken commits, and re-create them (ie basically 
>    doing a "git reset <known-good-state>" plus re-committing the working 
>    tree or perhaps re-doing a whole "git am" series or something)

The important part here is that it's only the *new* state that can be this kind of "broken commits". In other words, you'd never have to re-do actual *old* commits, just the commits you were doing as things crashed - the commits that you were in the middle of doing, and still have the data for.

Example from my case: I may have series of 250+ commits that I create with "git am" when I sync up with Andrew, and I very much want the speed of being able to create all that new commit data without ever even causing a _single_ synchronous disk write.

So if the machine were to crash in the middle of the series, I might lose all of that data, but I still have my mailbox, so I'd just need to reset to the point before I even started the "git am", and re-do the whole series. My actual *base* repository objects would never get corrupted.

[ And one final notice: I don't know about others, but I've actually had 
  more corruption from disks going bad etc that from system crashes per 
  se. And when *that* happens, old data is obviously as easily gone as new 
  data is. So absolutely _nothing_ replaces backups. It doesn't matter if 
  you do a "fsync()" after every single byte write - a disk crash can and 
  will corrupt things that were "stable". So even "stable storage" is 
  very much unstable in the end. ]
			Linus
Previous: Linus TorvaldsNext: Frank Ch. Eigler
Message 8 of 15 in “reducing prune sync()s”
  1. Frank Ch. EiglerMay 29, 2008
  2. Linus TorvaldsMay 30, 2008
  3. Linus TorvaldsMay 30, 2008
  4. Frank Ch. EiglerMay 30, 2008
  5. Florian WeimerMay 30, 2008
  6. David DillowMay 30, 2008
  7. Linus TorvaldsMay 30, 2008
  8. Linus TorvaldsMay 30, 2008
  9. Frank Ch. EiglerMay 30, 2008
  10. Linus TorvaldsMay 30, 2008
  11. 1/2 Make pack creation always fsync() the resultLinus Torvalds, May 30, 2008
  12. 2/2 Remove now unnecessary 'sync()' callsLinus Torvalds, May 30, 2008
  13. Nicolas PitreMay 30, 2008
  14. Frank Ch. EiglerMay 31, 2008
  15. Linus TorvaldsJun 2, 2008

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.