Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Sync vs. fsync during checkpoint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>,PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [HACKERS] Sync vs. fsync during checkpoint
Date: 2004-02-09 16:26:43
Message-ID: 20321.1076344003@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32
Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> The whole sync() vs. fsync() discussion is in my opinion nonsense at 
> this point.

The sync vs fsync discussion is not about performance, it is about
correctness.  You can't simply dismiss the fact that we don't know
whether a checkpoint is really complete when we write the checkpoint
record.

I liked the idea put forward by (I think) Kevin Brown, that we issue
sync to start the I/O and then a bunch of fsyncs to wait for it to
finish.  If sync behaves per spec ("all the I/O is scheduled upon
return") then the fsyncs will not affect I/O ordering in the least.
But they will ensure that we don't proceed until the I/O is all done.

Also there is the Windows-port problem of not having sync available.
Doing the fsyncs only will provide an adequate, if possibly
lower-performing, solution there.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: PGDate: 2004-02-09 16:36:03
Subject: postmaster wedged
Previous:From: Andreas PflugDate: 2004-02-09 15:53:34
Subject: Re: RFC: Very large scale postgres support

pgsql-hackers-win32 by date

Next:From: Bruce MomjianDate: 2004-02-09 16:51:01
Subject: Re: Updated win32 readdir patch
Previous:From: Jan WieckDate: 2004-02-09 14:33:09
Subject: Re: [HACKERS] Sync vs. fsync during checkpoint

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group