Thread

  1. fsync -> fdatasync in backend/storage/file/fd.c

    Michal Mosiewicz <mimo@interdata.com.pl> — 1998-04-17T00:22:58Z

    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
    
    
  2. Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c

    Marc G. Fournier <scrappy@hub.org> — 1998-04-17T01:27:10Z

    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 
    
    
    
  3. Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c

    Bruce Momjian <maillist@candle.pha.pa.us> — 1998-04-17T01:38:03Z

    > 
    > 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)
    
    
  4. Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c

    Michal Mosiewicz <mimo@interdata.com.pl> — 1998-04-17T01:53:03Z

    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
    
    
  5. Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c

    Marc G. Fournier <scrappy@hub.org> — 1998-04-17T02:24:08Z

    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 
    
    
    
  6. Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c

    ocie@paracel.com — 1998-04-17T02:27:21Z

    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
    
    
  7. Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c

    Mattias Kregert <matti@algonet.se> — 1998-04-18T14:18:27Z

    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 */
    
    
  8. Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c

    Marc G. Fournier <scrappy@hub.org> — 1998-04-18T17:57:23Z

    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 
    
    
    
  9. Re: [HACKERS] fsync -> fdatasync in backend/storage/file/fd.c

    Mattias Kregert <matti@algonet.se> — 1998-04-19T00:46:18Z

    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 */