Re: win32 performance - fsync question

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
To: "E(dot)Rodichev" <er(at)sai(dot)msu(dot)su>
Cc: chriskl(at)familyhealth(dot)com(dot)au, mha(at)sollentuna(dot)net, pgsql-hackers(at)postgresql(dot)org
Subject: Re: win32 performance - fsync question
Date: 2005-02-17 15:09:35
Message-ID: 20050217100935.71c71e51.darcy@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 17 Feb 2005 17:54:38 +0300 (MSK)
"E.Rodichev" <er(at)sai(dot)msu(dot)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(at)druid(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2005-02-17 15:18:22 Re: win32 performance - fsync question
Previous Message E.Rodichev 2005-02-17 14:54:38 Re: win32 performance - fsync question