( )⚙ D6722 fncache: make debugrebuildfncache not fail on broken fncache

This is an archive of the discontinued Mercurial Phabricator instance.

fncache: make debugrebuildfncache not fail on broken fncache
ClosedPublic

Authored by valentin.gatienbaron on Aug 12 2019, 2:13 PM.

Details

Summary

The code reading the fncache changed in 5.0, to complain if the file
is not \n terminated. This makes apparent the fact that the fncache
gets corrupted.

Make it possible to recover, instead of having `hg
debugrebuildfncache` failing by saying (run hg debugrebuildfncache).

The corruption itself is most likely due to hg not using fsync in
general, and so various bad things can happen. Here, the reported
problems happened when running out of disk space. So I suspect that
because the fncache is much bigger than the average commit/pull, when
running out of disk space, the bulk of the pull may succeed, but the
new fncache may get half-written and still renamed into place.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

pulkit accepted this revision.Aug 12 2019, 4:45 PM
pulkit added a subscriber: pulkit.

Queued these for stable branch. Many thanks!

This revision is now accepted and ready to land.Aug 12 2019, 4:45 PM