Corrupted repo

John Arbash Meinel john at arbash-meinel.com
Thu Sep 21 16:46:29 BST 2006


Andrew King wrote:
> Hi,
> 
> I have a bit of a problem ...
> 
> If I try and checkout or branch from the main repo we have, I get the
> following error:
> 
>  bzr: ERROR: Knit 8f/bar.cpp-20060905082118-5jpoevwlajw67yna-162.knit
> corrupt: unexpected version, wanted '
> james at machine1-20060905084816-c0d6456c1d5bec4e', got
> 'kingos at machine2-20060920005713-5325a7e72d321a6a'
> 
> This is using bzr 0.10 on linux. There are multiple people using the
> repo, virtually all via sftp transport.
> The repo has no working tree.
> 
> I have no idea how it got corrupted, but there have been a lot of
> sweeping commits (ie. removing lots of files, renaming lots of files).
> 
> Branching off another copy of the repo seems to work fine.
> 
> Pushing and pulling commits from the repo seems to work fine.
> 
> Any help appreciated!
> 
> Cheers,
> Andrew

Well, judging by the error message, what happened is that your Knit
index file (.kndx) said that a specific text was available in the Knit
data files (.knit) at a given offset. But when it actually looked there,
it found that the data was different.

I would be willing to investigate it further if you want to post the
contents somewhere, or send me the files.

In general, it should be hard to achieve something like this, unless 2
people are modifying the same file at the same time. Which should be
prevented by locking the repository. At a first guess, it sounds like
someone was doing something that took a long time, and someone else
thought the repository was stuck, and so either ran 'bzr break-lock', or
manually removed the lock directory.

If that is the problem, I have a patch which allows waiting on a
repository lock, and alerting the user how stale the lock is, etc. This
would make it less likely that people would break a real lock. But if
someone ever uses 'bzr break-lock' it *is* possible to corrupt the
repository (which is why we have them :)

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060921/51e7ce28/attachment.pgp 


More information about the bazaar mailing list