Re: sync() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: sync()
Date
Msg-id 1669.1042008417@sss.pgh.pa.us
Whole thread Raw
In response to Re: sync()  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Responses Re: sync()  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Re: sync()  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Tatsuo Ishii <t-ishii@sra.co.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,
althoughscheduled, is not necessarily complete upon    return from sync.
 
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: sync()
Next
From: Tatsuo Ishii
Date:
Subject: Re: sync()