Re: Fwd: Is the fsync() fake on FreeBSD6.1? - Mailing list pgsql-hackers

From AgentM
Subject Re: Fwd: Is the fsync() fake on FreeBSD6.1?
Date
Msg-id 11E1CA24-F602-46B6-B623-F3A33AC41A5C@themactionfaction.com
Whole thread Raw
In response to Re: Fwd: Is the fsync() fake on FreeBSD6.1?  (mark@mark.mielke.cc)
List pgsql-hackers
On Sep 22, 2006, at 15:00 , mark@mark.mielke.cc wrote:

> On Fri, Sep 22, 2006 at 01:52:02PM -0400, Jim Nasby wrote:
>> I thought folks might be interested in this... note in particular the
>> comment about linux.
> ...
>>> From: Greg 'groggy' Lehey <grog@FreeBSD.org>
>>> Date: June 26, 2006 11:34:12 PM EDT
>>> To: leo huang <leo.huang.list@gmail.com>
>>> Cc: freebsd-performance@freebsd.org
>>> Subject: Re: Is the fsync() fake on FreeBSD6.1?
>>> ...
>>> My understanding from the last time I looked at the code was that
>>> fsync does the right thing:
>>>
>>>     The fsync() system call causes all modified data and
>>> attributes of fd to
>>>     be moved to a permanent storage device.  This normally results
>>> in all in-
>>>     core modified copies of buffers for the associated file to be
>>> written to
>>>     a disk.

This is probably the same issue that the hackers encountered on  
Darwin- namely fsync() flushes the kernel cache, but a further  
function call was needed to flush the hard drive buffers. This meets  
the standard's definition of fsync because the data is indeed moved  
to the device, but it happens to just be the device's buffer instead  
of non-volatile storage.

-M


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fwd: Is the fsync() fake on FreeBSD6.1?
Next
From: Tom Lane
Date:
Subject: Re: initdb ignores invalid locale names