Re: Bug in ginRedoRecompress that causes opaque data on page to be overrun

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: Bug in ginRedoRecompress that causes opaque data on page to be overrun
Дата
Msg-id CAPpHfdv3HLMWY8W8eh-djG6ar_coZzQnVmRVYh3-EtrtxccgAw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Bug in ginRedoRecompress that causes opaque data on page to beoverrun  ("R, Siva" <sivasubr@amazon.com>)
Ответы Re: Bug in ginRedoRecompress that causes opaque data on page to beoverrun  ("R, Siva" <sivasubr@amazon.com>)
Список pgsql-hackers
On Thu, Sep 6, 2018 at 12:53 AM R, Siva <sivasubr@amazon.com> wrote:
> On Tue, Sep 5, 2018 at 08:55 PM, Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
> > Finally I managed to reproduce the bug.  The scenario is following.
> > Underlying idea is that when insertion of multiple tuples goes to the
> > beginning of the page and this insertion succeed only thanks to
> > collapse of some short segments together, then this insertion wouldn't
> > fit to the page if given alone.
>
> Sorry for the late reply.
> Thank you so much for working on this and reproducing the issue!
> Like you mentioned, the WAL record where we detected this problem
> has future segments deleted due to compaction and written out
> as an insert segment.
>
> > alter index test_idx set (fastupdate = on);
> Just curious why does this help with the repro? This is related to only
> using the Gin pending list vs the posting tree.

With (fastupdate = on) GIN performs bulk update of posting lists,
inserting multiple tuples at once if possible.  With (fastupdate =
off) GIN always inserts tuples one-by-one.  It might be still possible
to reproduce the issue with (fastupdate = off), but it seems even
harder.

BTW, I've tried the patch you've posted.  On my test case it fails
with following assertion.
TRAP: FailedAssertion("!(a_action == 2)", File: "ginxlog.c", Line: 243)

I thought about fixing this issue more, and I decided we can fix it in
less invasive way.  Once modification is started we can copy tail of
the page into separately allocated chunk of memory, and the use it as
the source of original segments.  See the patch attached.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Вложения

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

Предыдущее
От: Chris Travers
Дата:
Сообщение: Re: Funny hang on PostgreSQL 10 during parallel index scan on slave
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe perprocess