Re: sync()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: sync()
Date: 2003-01-08 06:18:35
Message-ID: 200301080618.h086IZU29394@candle.pha.pa.us
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.

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

  • sync() at 2003-01-08 06:08:49 from Tatsuo Ishii

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-01-08 06:34:49 Re: sync()
Previous Message Tatsuo Ishii 2003-01-08 06:08:49 sync()