Re: BufferSync() performance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BufferSync() performance
Дата
Msg-id 10376.1236285536@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BufferSync() performance  (Guido Ostkamp <postgresql@ostkamp.fastmail.fm>)
Список pgsql-general
Guido Ostkamp <postgresql@ostkamp.fastmail.fm> writes:
> Would this work or is there a special reason why the original check was
> done with lock held?

This will fail, very nastily, on multiple-CPU machines with weak memory
ordering guarantees.  You can't assume you are seeing an up-to-date
value of the flag bit if you don't take the spinlock first.

There are places where we can get away with such things because a
slightly stale answer is okay, but not in BufferSync().  Failing to
include a dirty page in the checkpoint is fatal.

            regards, tom lane

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

Предыдущее
От: Richard Greenwood
Дата:
Сообщение: Re: not quite a cross tab query...
Следующее
От: Greg Smith
Дата:
Сообщение: Re: BufferSync() performance