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

Re: [PATCH 0/3] don't let disk corruptions escape pack SHA1 checksum

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 29, 2008, 04:55 UTC
Message-ID
<20080829045535.GB28492@spearce.org>
In-Reply-To
<alpine.LFD.1.10.0808282142490.1624@xanadu.home>
Nicolas Pitre <nico@cam.org> wrote:
Show 16 quoted lines
> 
> So here is 3 patches for this in C git (Shawn already did it for jgit).
> 
> There are 3 spots where this needs to be plugged: in pack-objects, 
> index-pack and fast-import.  I did the first two.
> 
> I don't think this is that pertinent in fast-import because:
> 
>  - we want fast-import to be fast
> 
>  - after fast-import is done, a full repack is typically done which 
>    would revalidate everything (maybe fast-import should use index v2 
>    with its per object CRC32 though)
> 
> But maybe I'm wrong about that. In any case, I am leaving the 
> fast-import to someone more knowledgeable about its code than I do.

fast-import is the backend to a number of incremental import tools. They stream data in from foreign VCS systems (notably Perforce) and write into a live repository. That repository may not get repacked for days/weeks. We should treat it just like index-pack.

So I think we should plug it. The cost to keep a running SHA-1 for what we have written is pretty low. I'd rather trade off a minute or so on an hour long import for data safety than have a chance for data corruption going unnoticed by the end user.

And now that index v2 is available, yea, fast-import should write its index in that format so that a later repack can safely delta reuse if it (by rare chance) decides the current packed form is the best representation. This is especially true with "git gc --auto" triggering a repack every so often due to the incremental import packs I just metioned above.

I've just been too busy with other things to add index v2 support.
-- 
Shawn.
Previous: Nicolas Pitre
Message 16 of 16 in “don't let disk corruptions escape pack SHA1 checksum”
  1. 0/3 don't let disk corruptions escape pack SHA1 checksumNicolas Pitre, Aug 29, 2008
  2. 1/3 improve reliability of fixup_pack_header_footer()Nicolas Pitre, Aug 29, 2008
  3. 2/3 pack-objects: use fixup_pack_header_footer()'s validation modeNicolas Pitre, Aug 29, 2008
  4. 3/3 index-pack: use fixup_pack_header_footer()'s validation modeNicolas Pitre, Aug 29, 2008
  5. Shawn O. PearceAug 29, 2008
  6. Nicolas PitreAug 29, 2008
  7. Shawn O. PearceAug 29, 2008
  8. 0/5 pack header rewriting improvementsNicolas Pitre, Aug 29, 2008
  9. 1/5 pack-objects: improve returned information from write_one()Nicolas Pitre, Aug 29, 2008
  10. 2/5 improve reliability of fixup_pack_header_footer()Nicolas Pitre, Aug 29, 2008
  11. 3/5 pack-objects: use fixup_pack_header_footer()'s validation modeNicolas Pitre, Aug 29, 2008
  12. 4/5 index-pack: use fixup_pack_header_footer()'s validation modeNicolas Pitre, Aug 29, 2008
  13. 5/5 fixup_pack_header_footer(): use nicely aligned buffer sizesNicolas Pitre, Aug 29, 2008
  14. Junio C HamanoAug 31, 2008
  15. Nicolas PitreAug 29, 2008
  16. Shawn O. PearceAug 29, 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.