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

From: "R, Siva" <sivasubr(at)amazon(dot)com>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, "sawada(dot)mshk(at)gmail(dot)com" <sawada(dot)mshk(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in ginRedoRecompress that causes opaque data on page to be overrun
Date: 2018-09-05 21:49:05
Message-ID: 1536184145340.65860@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 5, 2018 at 08:55 PM, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)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.

I will try to reproduce the issue with the above workload and
also test the fix with the same and report back.

On Wed, Sep 5, 2018 at 5:24 PM, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> Hmm, could you share the sequence of what kind of WAL has applied to
> the broken page? I suspect the segment list contains
> GIN_SEGMENT_REPLACE before GIN_SEGMENT_INSERT.

These are the segment operations on the WAL in sequence:
- 1 Replace action on segment N
- 5 Insert actions after segment N - the 5th insert action is essentially
replacing the last 3 remaining segments with a new one.
- 3 delete actions on the remaining segments.

Best
Siva

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-09-05 22:07:25 Re: *_to_xml() should copy SPI_processed/SPI_tuptable
Previous Message Andrew Gierth 2018-09-05 21:45:49 pgsql: Allow extensions to install built as well as unbuilt headers.