need automatic recovery from truncated pack/index files

Bug #655503 reported by Martin Pool
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
High
Unassigned

Bug Description

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 (bug 343427)
 - 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

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 655503] [NEW] need automatic recovery from truncated pack/index files

Note that I think fsyncdata may be needed, on the files and the
directories. (file content and metadata being separate..)

Martin Pool (mbp)
description: updated
Revision history for this message
Alexander Belchenko (bialix) wrote :

Martin Pool пишет:
> - 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

Please, please, please.

One man from hg community all the time telling people how slow `bzr
check` comparing to `hg verify` and how it's important for him.
I think, given in mind that we have less pack files in post pack-0.92
formats than "knit" files in older formats and hg, we can do much faster
check by simply hashing files without analyzing its content. But I have
a question though: can index files be hashed efficiently? Looking at the
index file header I don't see there any checksum info.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.