From: R, Siva <sivasubr@amazon.com>
To: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: sawada.mshk@gmail.com <sawada.mshk@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Bug in ginRedoRecompress that causes opaque data on page to be overrun
Date: Wed, 5 Sep 2018 21:49:05 +0000
Message-ID: <1536184145340.65860@amazon.com> (raw)
In-Reply-To: <CAPpHfduRz9qeqxVQh+2FAj+uQ040qzijYOM6Lc2o7873UzVL3w@mail.gmail.com>
References: <1536091151804.6588@amazon.com>
<CAH2-WzneRxhYubPMh-x0L7h_1iH5kddVH5HWx2RFWKh=ELdgzw@mail.gmail.com>
<1536101117759.63175@amazon.com>
<CAPpHfdv1FkM3Lk7xGh1Wmo+u7xKV9GqNzLkc2mxiiX5OOqkN1Q@mail.gmail.com>
<CAPpHfduH0P9onLnkGGMM_Pze5J47qjHFxFxouWkhYxBebq0mrQ@mail.gmail.com>
<CAPpHfdtS2hHJBT4bOnk2FJDzE1yCvRDveAjrW_Oi3aAK1MtrGw@mail.gmail.com>
<CAPpHfduRz9qeqxVQh+2FAj+uQ040qzijYOM6Lc2o7873UzVL3w@mail.gmail.com>
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.
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.mshk@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: sivasubr@amazon.com, a.korotkov@postgrespro.ru, sawada.mshk@gmail.com
Subject: Re: Bug in ginRedoRecompress that causes opaque data on page to be overrun
In-Reply-To: <1536184145340.65860@amazon.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox