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

From D'Arcy J.M. Cain
Subject Re: win32 performance - fsync question
Date
Msg-id 20050217100935.71c71e51.darcy@druid.net
Whole thread Raw
In response to Re: win32 performance - fsync question  ("E.Rodichev" <er@sai.msu.su>)
List pgsql-hackers
On Thu, 17 Feb 2005 17:54:38 +0300 (MSK)
"E.Rodichev" <er@sai.msu.su> wrote:
> On Thu, 17 Feb 2005, Christopher Kings-Lynne wrote:
> 
> >> The general question is - does PostgreSQL really need fsync? I
> >suppose it> is a question for design, not platform-specific one. It
> >sounds like only> one scenario, when fsync is useful, is to
> >interprocess communication via> open file. But PostgreSQL utilize IPC
> >for this, so does fsync is really> required?
> >
> > NO!
> >
> > 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 again!

Fsck only fixes up file system pointers after a crash.  If the data did
not make it to the disk, no amount of fscking will put it there.

I'm not positive but I think that journalled file systems also need
fsync to guarantee that the information gets journalled but in any case,
journalling only helps if you have a journalled file system.  Not
everyone does.

This is not to say that fsync is always required, just that it solves a
different problem than all those other tools.

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: "E.Rodichev"
Date:
Subject: Re: win32 performance - fsync question
Next
From: Doug McNaught
Date:
Subject: Re: win32 performance - fsync question