[Python-Dev] Re: RELEASED Python 2.3.1

Guido van Rossum guido at python.org
Sat Sep 27 22:03:38 EDT 2003


> [Jeremy Hylton]
> > I suppose ZODB is such an expert application.  It has to cope with
> > systems that do not provide fsync(), but it provides degraded service
> > on such platforms.  It is very important for the database to call
> > fsync() when it commits a transaction.

[Tim]
> I'm not sure that ZODB *intends* to run on any system w/o fsync anymore.  It
> had to before 2.3 because os.fsync() didn't exist on Windows, and ZODB has
> to run on Windows.  I implemented os.fysnc() for Windows in 2.3 precisely so
> that ZODB would work better on Windows.
> 
> More mundanely, as I recall, we were having a specific problem wherein a
> backup script wasn't getting the correct size for a ZODB Data.fs file on
> Windows, and file.flush()'ing Data.fs didn't help enough -- backup kept
> screwing up until FileStorage's
> 
>             if fsync is not None: fsync(file.fileno())
> 
> actually did something on Windows.

Bizarre.  On Unix, fsync()'s only point is to do something that is
only ever noticeable if there's an OS or hardware failure.  But on
Windows, it was needed to get the OS to synchronize the directory
contents so that another process or thread would see the right thing.

Anyway, I think that on Unix, that problem doesn't exist, and there
the only problem of not having fsync() is the minuscule risk of
hardware or OS failure right after you wrote the data but before it
actually was written to the media.

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-Dev mailing list