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

Re: broken repo after power cut

From
CHChristoph Hellwig <hch@infradead.org>
Date
Jun 21, 2015, 13:59 UTC
Message-ID
<20150621135903.GA18719@infradead.org>
In-Reply-To
<5586B71D.2070407@nod.at>
On Sun, Jun 21, 2015 at 03:07:41PM +0200, Richard Weinberger wrote:
> >> To me it seems like git was creating a new object and got interrupted
> >> before fsync/fdatasync'ing it.
> >> As the object was referenced before syncing the data to disk the repo broke.

Git doesn't fsync by default, and because of that I've seen similar data losses on ext4/xfs/btrfs.

You can set the core.fsyncobjectfiles to mitigate it, but even with that I've seen corrupted index files.

Note that I've been mostly on old git versions from various distros, so in case this was fixed recently I'll take everything I said back.

Previous: Richard WeinbergerNext: Richard Weinberger
Message 4 of 8 in “broken repo after power cut”
  1. Richard WeinbergerJun 20, 2015
  2. Johannes SchindelinJun 21, 2015
  3. Richard WeinbergerJun 21, 2015
  4. Christoph HellwigJun 21, 2015
  5. Richard WeinbergerJun 21, 2015
  6. Theodore Ts'oJun 22, 2015
  7. Richard WeinbergerJun 22, 2015
  8. Theodore Ts'oJun 22, 2015

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.