Re: sync()

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: sync()
Дата
Msg-id 20030108.153644.102580357.t-ishii@sra.co.jp
обсуждение исходный текст
Ответ на Re: sync()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: sync()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: sync()
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: sync()