From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: kunert@cms.hu-berlin.de, pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Cc: Alexander Lakhin <exclusion@gmail.com>
Subject: Re: BUG #16162: create index using gist_trgm_ops leads to panic
Date: Sat, 14 Dec 2019 00:02:52 +0200
Message-ID: <2ca3ae2a-e770-012b-3da1-169a3818927a@iki.fi> (raw)
In-Reply-To: <20191213001618.jqeousv77xnlds7x@development>
References: <16162-45d21b7b6c1a3105@postgresql.org>
<20191212125023.vpk6zbbeldzmyerc@development>
<26141.1576158262@sss.pgh.pa.us>
<CAMkU=1ymVJWS_u6ndDarWfaOQz44Td2DWgpA_3t4+OV4xsV3WQ@mail.gmail.com>
<20191213001618.jqeousv77xnlds7x@development>
On 13/12/2019 02:16, Tomas Vondra wrote:
> On Thu, Dec 12, 2019 at 07:05:53PM -0500, Jeff Janes wrote:
>> On Thu, Dec 12, 2019 at 8:44 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> I wonder if this could be a recently-introduced bug? I do not
>>> recall seeing complaints like this before v12.
>>
>> Looks like the culprit is:
>>
>> commit 9155580fd5fc2a0cbb23376dfca7cd21f59c2c7b
>> Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
>> Date: Wed Apr 3 17:03:15 2019 +0300
>>
>> Generate less WAL during GiST, GIN and SP-GiST index build.
>>
>> The commit before went 150 iterations with no failures, while this one
>> failed on the 15th iteration, then again on 4th.
>
> Thanks for the bisect. I've planned to try reproducing this on 11, but
> this commit only in 12, so Tom is right it's a recent bug.
Like Tom suspected at [1], the bug was that the parent page got split,
and the stacked information wasn't updated. The code called
gistFindCorrectParent(), which should've updated the stack, but that
function checked the LSN of the page and did nothing if it matched. To
trigger the bug, you needed to have an insertion that split a page into
three (or more) pages, and inserting the downlink caused the parent page
to split, too.
Committed a fix. Many thanks for the reproducer scripts, Andreas and
Alexander!
[1] https://www.postgresql.org/message-id/9409.1574617130%40sss.pgh.pa.us
- Heikki
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-bugs@postgresql.org
Cc: hlinnaka@iki.fi, tomas.vondra@2ndquadrant.com, jeff.janes@gmail.com, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org, exclusion@gmail.com
Subject: Re: BUG #16162: create index using gist_trgm_ops leads to panic
In-Reply-To: <2ca3ae2a-e770-012b-3da1-169a3818927a@iki.fi>
* 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