Re: win32 performance - fsync question

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: "E(dot)Rodichev" <er(at)sai(dot)msu(dot)su>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: win32 performance - fsync question
Date: 2005-02-17 15:18:22
Message-ID: 87psyzuse9.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"E.Rodichev" <er(at)sai(dot)msu(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-02-17 15:21:48 Re: win32 performance - fsync question
Previous Message D'Arcy J.M. Cain 2005-02-17 15:09:35 Re: win32 performance - fsync question