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

Re: safer git?

From
Hhv@crypt.org <hv@crypt.org>
Date
Oct 25, 2020, 12:45 UTC
Message-ID
<202010251245.09PCjIP26203@crypt.org>
In-Reply-To
<20201025030606.GF860779@camp.crustytoothpaste.net>

"brian m. carlson" wrote: :You can try setting core.fsyncObjectFiles to true.

Super, that's exactly the sort of thing I was hoping to find.

:I suspect a lot of the zero-byte files and any files that end up as :all-zeros are due to your file system. The default file system on :Ubuntu is ext4, IIRC, and if that's what you're using, you can set :data=journal instead of data=ordered as a mount option.

It is indeed ext4. I'll consider this option; for now I've turned off write caching as suggested by Randall, which feels like a lighter-weight approach that should give almost all of the benefit.

:"Randall S. Becker" wrote: :> I would suggest turning off write-through buffering on your disk. Let writes :> complete immediately instead of being deferred to sync. Also, this does feel :> like a disk issue, so fsck or chkdsk /f (or whatever) on your disk urgently.

fsck doesn't seem to be complaining, but I've set it to run every 20 mounts. What I do see is a handful of "orphaned inodes" being reclaimed on boot after every crash.

:Turning off buffering and caching for your disk drive may make things :_really_ slow, but it will definitely improve data integrity.

I haven't noticed a big slowdown so far; I'm rarely doing a _lot_ of writes.

Thanks greatly to both of you for the suggestions.
Hugo
Previous: brian m. carlsonNext: Randall S. Becker
Message 5 of 6 in “safer git?”
  1. hv@crypt.orgOct 24, 2020
  2. hv@crypt.orgOct 24, 2020
  3. Randall S. BeckerOct 24, 2020
  4. brian m. carlsonOct 25, 2020
  5. hv@crypt.orgOct 25, 2020
  6. Randall S. BeckerOct 25, 2020

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.