Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c - Mailing list pgsql-hackers

From ocie@paracel.com
Subject Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c
Date
Msg-id 9804170227.AA27585@dolomite.paracel.com
Whole thread Raw
In response to Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c  (The Hermit Hacker <scrappy@hub.org>)
List pgsql-hackers
The Hermit Hacker wrote:
>
> On Fri, 17 Apr 1998, Michal Mosiewicz wrote:
>
> > I don't remember if it has been mentioned.
> >
> > Anyhow, I think that it would be nice to change fsync'es into
> > fdatasync'es (of course as an autoconf-igurable option). I don't think
> > it's necessary to update all file's metadata each time a file is
> > flushed.
> >
> > I dunno where it's implemented. But it's for sure implemented in Linux.
>
>     We don't have it (FreeBSD)...what does it do? *raised eyebrow*
> And, how many ppl actually have fsync's enabled?

It's a POSIX thing.  fsync will sync the data and the metadata, but
fdatasync only syncs the data.  So in the case of a crash, the inode
might not have the right date, etc.  This can speed things up, but I
wouldn't venture a guess as to how much.

Ocie

pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c
Next
From: "Thomas G. Lockhart"
Date:
Subject: Re: [INTERFACES] Re: ODBC driver