Re: fsync alternatives (was: Re: [HACKERS] TODO item) - Mailing list pgsql-hackers

From Chris Bitmead
Subject Re: fsync alternatives (was: Re: [HACKERS] TODO item)
Date
Msg-id 389F5623.EB540669@nimrod.itg.telecom.com.au
Whole thread Raw
In response to Re: fsync alternatives (was: Re: [HACKERS] TODO item)  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian wrote:
> 
> > > So, I think we are safe if we can either keep that file descriptor open
> > > until commit, or re-open it and fsync it on commit.  That assume a
> > > re-open is hitting the same file.  My opinion is that we should just
> > > fsync it on close and not worry about a reopen.
> >
> > I'm pretty sure that the standard is that a close on a file _should_
> > fsync it.
> 
> This is not true.  close flushes the user buffers to kernel buffers.  It
> does not force to physical disk in all cases, I think.  

fclose flushes user buffers to kernel buffers. close only frees the file
descriptor for re-use.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] TODO item
Next
From: Chris Bitmead
Date:
Subject: Re: [HACKERS] ONLY