Re: sync()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(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 06:34:49
Message-ID: 1537.1042007689@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tatsuo Ishii wrote:
>> Can someone tell me why we need sync() here?

> As part of checkpoint, we discard some WAL files. To do that, we must
> first be sure that all the dirty buffers we have written to the kernel
> are actually on the disk. That is why the sync() is required.

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.

regards, tom lane

In response to

  • Re: sync() at 2003-01-08 06:18:35 from Bruce Momjian

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2003-01-08 06:36:44 Re: sync()
Previous Message Bruce Momjian 2003-01-08 06:18:35 Re: sync()