Re: [BUG] Error in BRIN summarization

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [BUG] Error in BRIN summarization
Дата
Msg-id 20200812001952.GA2341@alvherre.pgsql
обсуждение исходный текст
Ответ на [BUG] Error in BRIN summarization  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Ответы Re: [BUG] Error in BRIN summarization  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On 2020-Jul-23, Anastasia Lubennikova wrote:

> This error is caused by the problem with root_offsets array bounds. It
> occurs if a new HOT tuple was inserted after we've collected root_offsets,
> and thus we don't have root_offset for tuple's offnum. Concurrent insertions
> are possible, because brin_summarize_new_values() only holds ShareUpdateLock
> on table and no lock (only pin) on the page.

Excellent detective work, thanks.

> The draft fix is in the attachments. It saves root_offsets_size and checks
> that we only access valid fields.

I think this is more complicated than necessary.  It seems easier to
solve this problem by just checking whether the given root pointer is
set to InvalidOffsetNumber, which is already done in the existing coding
of heap_get_root_tuples (only they spell it "0" rather than
InvalidOffsetNumber, which I propose to change).  AFAIR this should only
happen in the 'anyvisible' mode, so I added that in an assert.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Improving connection scalability: GetSnapshotData()
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: Improving connection scalability: GetSnapshotData()