Re: Internals question about buffers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Internals question about buffers
Дата
Msg-id 11575.1023511676@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Internals question about buffers  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> Is there a race condition in ReadBufferInternal() ?

No.

As the comments in bufmgr.c point out, this is not bufmgr.c's problem:
* ReadBuffer -- returns a buffer containing the requested*        block of the requested relation.  If the blknum*
 requested is P_NEW, extend the relation file and*        allocate a new block.  (Caller is responsible for*
ensuringthat only one backend tries to extend a*        relation at the same time!)
 

In practice, the necessary locking is done by hio.c in the case of
heap relations:
*    Note that we use LockPage(rel, 0) to lock relation for extension.

and in the case of index relations the various index AMs have their own
approaches.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Schemas: status report, call for developers
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Schemas: status report, call for developers