Re: sync()

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: pgman(at)candle(dot)pha(dot)pa(dot)us
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: sync()
Date: 2003-01-08 06:36:44
Message-ID: 20030108.153644.102580357.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Tatsuo Ishii wrote:
> > I noticed sync() is used in PostgreSQL.
> >
> > CHECKPOINT -> FlushBufferPool() -> smgrsync() -> mdsync() -> sync()
> >
> > 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.

?? I thought WAL files are synced by pg_fsync() (if needed).
--
Tatsuo Ishii

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:39:17 Re: sync()
Previous Message Tom Lane 2003-01-08 06:34:49 Re: sync()