Re: Use of sync() [was Re: Potential Large Performance Gain in WAL synching] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Use of sync() [was Re: Potential Large Performance Gain in WAL synching]
Date
Msg-id 3943.1033834057@sss.pgh.pa.us
Whole thread Raw
In response to Use of sync() [was Re: Potential Large Performance Gain in WAL synching]  (Mats Lofkvist <mal@algonet.se>)
List pgsql-hackers
Mats Lofkvist <mal@algonet.se> writes:
> [ mdsync is ugly and not completely reliable ]

Yup, it is.  Do you have a better solution?

fsync is not the answer, since the checkpoint process has no way to know
what files may have been touched since the last checkpoint ... and even
if it could find that out, a string of retail fsync calls would kill
performance, cf. Curtis Faith's complaint.

In practice I am not sure there is a problem.  The local man page for
sync() says
    The writing, although scheduled, is not necessarily complete upon    return from sync.

Now if "scheduled" means "will occur before any subsequently-commanded
write occurs" then we're fine.  I don't know if that's true though ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] [GENERAL] CURRENT_TIMESTAMP
Next
From: Doug McNaught
Date:
Subject: Re: Use of sync() [was Re: Potential Large Performance Gain in WAL synching]