Comment 0 for bug 655503

Revision history for this message
Martin Pool (mbp) wrote :

The most common corruption-type problem we see at the moment is that users have 0-byte index or pack files. This is probably happening because of a machine crash or similar failure causing the filesystem to see the file exists but without any content.

It would be nice if we could more cleanly recover from this without people specifically needing to ask for help.

Some ideas:

 - an option to fsync files before treating the repository update as complete, so we're sure the data is really on disk before the packs are referenced
 - if we see a pack file with 0 bytes, treat it as nonexistent (and perhaps give a warning?)
 - teach check to hash the files and move away any that aren't consistent; perhaps give check an option to do only this quick/cheap check