Re: win32 performance - fsync question - Mailing list pgsql-hackers

From Doug McNaught
Subject Re: win32 performance - fsync question
Date
Msg-id 87psyzuse9.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to Re: win32 performance - fsync question  ("E.Rodichev" <er@sai.msu.su>)
List pgsql-hackers
"E.Rodichev" <er@sai.msu.su> writes:

> On Thu, 17 Feb 2005, Christopher Kings-Lynne wrote:
>
>> Fsync is so that when your computer loses power without warning, you
>> will have no data loss.
>>
>> If you turn it off, you run the risk of losing data if you lose power.
>>
>> Chris
>
> This problem is addressed by file system (fsck, journalling etc.).
> Is it reasonable to handle it directly within application?

No, it's not addressed by the file system.  fsync() tells the OS to
make sure the data is on disk.  Without that, the OS is free to just
keep the WAL data in memory cache, and a power failure could cause
data from committed transactions to be lost (we don't report commit
success until fsync() tells us the file data is on disk). 

-Doug


pgsql-hackers by date:

Previous
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: win32 performance - fsync question
Next
From: Andrew Dunstan
Date:
Subject: Re: win32 performance - fsync question