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.

Mike

-- 
WWW: http://www.lodz.pdi.net/~mimo  tel: Int. Acc. Code + 48 42 148340
add: Michal Mosiewicz  *  Bugaj 66 m.54 *  95-200 Pabianice  *  POLAND

Fri, 17 Apr 1998 02:22:58 +0200
Michal Mosiewicz <mimo@interdata.com.pl>
fsync -> fdatasync in backend/storage/file/fd.c
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?

Marc G. Fournier                                
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 


Thu, 16 Apr 1998 22:27:10 -0300 (ADT)
The Hermit Hacker <scrappy@hub.org>
Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c
> 
> 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 have a way of keeping proper consistency with a system sync() every
30 seconds.  See the archive.   I think it is on the short list.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

Thu, 16 Apr 1998 21:38:03 -0400 (EDT)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c
The Hermit Hacker wrote:

>         We don't have it (FreeBSD)...what does it do? *raised eyebrow*
> And, how many ppl actually have fsync's enabled?

When you fsync a file it usually costs at least two write operations,
one to write the data and one to update modification/access date, etc.
fdatasync synces only data area of the file without it's
metainformation.

It's not a Linux-only feature. In fact, I'm really not sure if it's
already implemented in Linux (the man page I've got states that in
2.0.23 it was a mere fsync alias) It is a part of POSIX1b standard.

Mike

-- 
WWW: http://www.lodz.pdi.net/~mimo  tel: Int. Acc. Code + 48 42 148340
add: Michal Mosiewicz  *  Bugaj 66 m.54 *  95-200 Pabianice  *  POLAND

Fri, 17 Apr 1998 03:53:03 +0200
Michal Mosiewicz <mimo@interdata.com.pl>
Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c
On Fri, 17 Apr 1998, Michal Mosiewicz wrote:

> The Hermit Hacker wrote:
> 
> >         We don't have it (FreeBSD)...what does it do? *raised eyebrow*
> > And, how many ppl actually have fsync's enabled?
> 
> When you fsync a file it usually costs at least two write operations,
> one to write the data and one to update modification/access date, etc.
> fdatasync synces only data area of the file without it's
> metainformation.

	Similar to us (FreeBSD) mounting our file systems 'noatime', so,
ya, we have it...

Marc G. Fournier                                
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 


Thu, 16 Apr 1998 23:24:08 -0300 (ADT)
The Hermit Hacker <scrappy@hub.org>
Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c
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

Thu, 16 Apr 1998 19:27:21 -0700 (PDT)
ocie@paracel.com
Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c
The Hermit Hacker wrote:

> 
>         We don't have it (FreeBSD)...what does it do? *raised eyebrow*
> And, how many ppl actually have fsync's enabled?

I always have fsync enabled.

/* m */

Sat, 18 Apr 1998 16:18:27 +0200
Mattias Kregert <matti@algonet.se>
Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c
On Sat, 18 Apr 1998, Mattias Kregert wrote:

> The Hermit Hacker wrote:
> 
> > 
> >         We don't have it (FreeBSD)...what does it do? *raised eyebrow*
> > And, how many ppl actually have fsync's enabled?
> 
> I always have fsync enabled.

	Why?  IMHO, the only use for this is where the system you are
running it on is suspect, and you fear it crashing alot...

Marc G. Fournier                                
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 


Sat, 18 Apr 1998 14:57:23 -0300 (ADT)
The Hermit Hacker <scrappy@hub.org>
Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c
The Hermit Hacker wrote:
>
> > I always have fsync enabled.
> 
>         Why?  IMHO, the only use for this is where the system you are
> running it on is suspect, and you fear it crashing alot...
> 

I started using the -F option to speed thing up, but then I had one
powerfailure which totally trashed postgresql. I could not recover
anything and had to restore from previous day's backup, loosing a
whole day of work. Then I started using fsync again.

Perhaps some emergency rescue utility would be useful in those cases
when some vital files are trashed. A utility which could go thru all
files and try to fix things missing in system catalogs and so on,
fix all obvious errors, recreate indices, remove duplicates, add
missing pieces...

/* m */


Sun, 19 Apr 1998 02:46:18 +0200
Mattias Kregert <matti@algonet.se>
Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c