Corrupt repository

Matt Mackall mpm at selenic.com
Fri Jun 26 11:43:34 CDT 2009


On Fri, 2009-06-26 at 08:44 -0400, Greg Ward wrote:
> Hi all --
> 
> I seem to have a corrupt repository:

You sure do.

> $ hg verify
> checking changesets
> checking manifests
>  8780: reading manifest delta b8195b66e870: Error -3 while
> decompressing data: incorrect data check
> crosschecking files in changesets and manifests
> checking files
>  tests/test-backout.out at 8780: a1af28e11331 not in manifests
> 1247 files, 8957 changesets, 17873 total revisions
> 2 integrity errors encountered!
> (first damaged changeset appears to be 8780)
> 
> I get the same crash running 'hg log', but if I use a template that
> avoids showing tags... no crash.  And I'm running a recent development
> version of hg.  So... is it a bug if Hg crashes on a corrupt
> repository?  Or business as usual?

Hg doesn't really 'crash', it only reports prettier or uglier
exceptions. We could probably make this one prettier.

> Also, is there any way to recover the repository?

Short of copying in a clean 00manifest.d, not really.

>   It's no big deal if
> I have to throw it away, but I'm curious.  And is there a way to
> figure out the source of the corruption: Hg bug or hardware error?

It's almost certainly a hardware error. Doing a binary compare on
00manifest.d against a good 00manifest.d should give us a hint what's
up.

single bit difference -> probably cosmic rays [1]
multiple bit flips in different bytes -> bus/cabling issues
blocks of zeros -> kernel or filesystem bug
blocks of data from other files -> kernel or filesystem bug 

You should also check if the problem persists over reboot. It's more
likely for corruption to appear when reading than when writing, as we
only write a block once.

[1] http://lwn.net/Articles/219983/

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial mailing list