Re: RE: xlog checkpoint depends on sync() ... seems uns afe

Поиск
Список
Период
Сортировка
От Matthew Kirkwood
Тема Re: RE: xlog checkpoint depends on sync() ... seems uns afe
Дата
Msg-id Pine.LNX.4.10.10103131046510.14830-100000@sphinx.mythic-beasts.com
обсуждение исходный текст
Ответ на Re: RE: xlog checkpoint depends on sync() ... seems uns afe  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, 13 Mar 2001, Tom Lane wrote:

> > I was told the same a long ago about FreeBSD. How much can we count on
> > this undocumented sync() feature?
> 
> Sounds quite unreliable to me.  Unless there's some interlock ...
> like, say, the second sync not being able to advance past a buffer
> page that's as yet unwritten by the first sync.  But would all Unixen
> share such a strange detail of implementation?

The Linux manpage says:

NAME      sync - commit buffer cache to disk.
[..]

DESCRIPTION      sync  first commits inodes to buffers, and then buffers to      disk.
[..]

CONFORMING TO      SVr4, SVID, X/OPEN, BSD 4.3

BUGS      According to  the  standard  specification  (e.g.,  SVID),      sync()  schedules  the  writes,  but may
returnbefore the      actual writing is done.   However,  since  version  1.3.20      Linux  does actually wait.  (This
stilldoes not guarantee      data integrity: modern disks have large caches.)
 


And it's still true.  On a fast system, if you do:

$ cp /dev/zero /tmp & sleep 1; sync

the sync will often never finish.  (Of course, that's
just an implementation detail really.)

Matthew.



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

Предыдущее
От: Denis Perchine
Дата:
Сообщение: Re: Performance monitor
Следующее
От: Zeugswetter Andreas SB
Дата:
Сообщение: AW: RE: xlog loose ends, continued