Re: sync()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: sync()
Date: 2003-01-08 14:51:01
Message-ID: 200301081451.h08Ep1K14305@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> writes:
> >> What we really need is something better than sync(), viz flush all dirty
> >> buffers to disk *and* wait till they're written. But sync() and sleep
> >> for awhile is the closest portable approximation.
>
> > Are you saying that fsync() might not wait untill the IO completes?
>
> No, I said that sync() might not. Read the man pages. HPUX's man
> page for sync(2) says
>
> sync() causes all information in memory that should be on disk to be
> written out.
> ...
> The writing, although scheduled, is not necessarily complete upon
> return from sync.

Yep, BSD/OS says:

BUGS
Sync() may return before the buffers are completely flushed.

At least they classify it as a bug.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-01-08 14:59:56 ODBC fix
Previous Message scott.marlowe 2003-01-08 14:30:11 Re: [GENERAL] I feel the need for speed. What am I doing