fsync in mercurial

Matt Mackall mpm at selenic.com
Sat Mar 14 10:35:54 CDT 2009


On Fri, 2009-03-13 at 14:05 -0700, Greg Lindahl wrote:
> With all the discussion about fsync and ext4, I was curious about
> Mercurial. It seems that mercurial doesn't use fsync, even for "atomic
> temp" files, which are used in exactly the same way that results in
> problems in POSIX filesystems: write to temp, (fsync), close, rename.
> 
> Is that a good idea?

fsync is a) immensely slow (can cause system-wide filesystem stalls for
many seconds) and b) doesn't guarantee file integrity on modern hardware
(many drives only guarantee that data has made it to their onboard
caches). 

Because fsync has such a negative effect on average I/O bandwidth, it
can actually increase the odds of hardware corruption by widening the
corruption window. It's not at all clear that fsync is desirable.

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial mailing list