Re: Re: Buffer access rules, and a probable bug

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: Buffer access rules, and a probable bug
Дата
Msg-id 24933.994179985@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Buffer access rules, and a probable bug  (Hiroshi Inoue <Inoue@tpf.co.jp>)
Список pgsql-hackers
Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> Tom Lane wrote:
>> I believe that nbtree.c's btbuild() code is currently in violation of
>> these rules, because it calls HeapTupleSatisfiesNow() while holding a
>> pin but no lock on the containing buffer.

> OK, we had better avoid using heapam routines in btbuild() ? 

On further thought, btbuild is not that badly broken at the moment,
because CREATE INDEX acquires ShareLock on the relation, so there can be
no concurrent writers at the page level.  Still, it seems like it'd be a
good idea to do "LockBuffer(buffer, BUFFER_LOCK_SHARE)" here, and
probably also to invoke HeapTupleSatisfiesNow() via the
HeapTupleSatisfies() macro so that infomask update is checked for.
Vadim, what do you think?
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: JDBC Support - prepared Statements?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: selecting from cursor