Avoid 00changelog.i corruption

Mads Kiilerich mads at kiilerich.com
Mon Jul 20 05:05:42 CDT 2009


On 07/20/2009 09:56 AM, Ingo Proetel wrote:
> Hi,
>
> I came across a problem while using VirtualBox running Ubuntu on a Windows XP host. When pushing a change from inside
> the VirtualBox to a repo that resides on a shared folder (a folder that exists on the underlying NTFS and is mounted in
> Ubuntu) I got a corrupted 00changelog.i. I found that python has a problem with opening files to append to. Apparently
> NULL characters are included when writing into such a file. While a broken append function is not a mercurial problem
> having corrupted data is a mercurial problem. Data corruption is not a problem you want to have with a version control
> system. A clean failure and rollback is acceptable thought.
>
> So I would suggest the following patch (or something a like it) to try to make sure that the written data is what is
> expected.
>
> $ hg log -p -r 9046
> changeset:   9046:91b293cf8a5e
> tag:         tip
> user:        Ingo Proetel<proetel at aicas.com>
> date:        Sat Jul 18 01:19:03 2009 +0200
> summary:     Make writing of changelog index more robust against data corruption.
>    

I have seen that with VirtualBox too.

But ... if Mercurial can't trust the operating system then who can it 
trust? I don't think we should add workaround and verification for such 
specific bugs; that doesn't scale.

Bug VirtualBox, not Mercurial. I guess the VirtualBox developers are 
using Mercurial, so they might even be aware of the importance of 
getting this fixed ;-)

Alternatively, perhaps the extra check could be placed in an extension?

/Mads



More information about the Mercurial mailing list