Re: Failure in contrib test _int on loach

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: Failure in contrib test _int on loach
Date: 2019-05-07 22:31:55
Message-ID: e61c56c4-f1e0-53a1-52c9-8a6c4c8506bc@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/05/2019 10:37, Heikki Linnakangas wrote:
> (resending, previous attempt didn't make it to pgsql-hackers)
>
> On 29/04/2019 16:16, Anastasia Lubennikova wrote:
>> In previous emails, I have sent two patches with test and bugfix (see
>> attached).
>> After Heikki shared his concerns, I've rechecked the algorithm and
>> haven't found any potential error.
>> So, if other hackers are agreed with my reasoning, the suggested fix is
>> sufficient and can be committed.
>
> I still believe there is a problem with grandparent splits with this.
> I'll try to construct a test case later this week, unless you manage to
> create one before that.

Here you go. If you apply the two patches from
https://www.postgresql.org/message-id/5d48ce28-34cf-9b03-5d42-dbd5457926bf%40postgrespro.ru,
and run the attached script, it will print out something like this:

postgres=# \i grandparent.sql
DROP TABLE
CREATE TABLE
INSERT 0 150000
CREATE INDEX
psql:grandparent.sql:27: NOTICE: working on 10000
psql:grandparent.sql:27: NOTICE: working on 20000
psql:grandparent.sql:27: NOTICE: working on 30000
psql:grandparent.sql:27: NOTICE: working on 40000
psql:grandparent.sql:27: NOTICE: working on 50000
psql:grandparent.sql:27: NOTICE: working on 60000
psql:grandparent.sql:27: NOTICE: working on 70000
psql:grandparent.sql:27: NOTICE: working on 80000
psql:grandparent.sql:27: NOTICE: working on 90000
psql:grandparent.sql:27: NOTICE: working on 100000
psql:grandparent.sql:27: NOTICE: working on 110000
psql:grandparent.sql:27: NOTICE: failed for 114034
psql:grandparent.sql:27: NOTICE: working on 120000
DO

That "failed for 114034" should not happen.

Fortunately, that's not too hard to fix. We just need to arrange things
so that the "retry_from_parent" flag also gets set for the grandparent,
when the grandparent is split. Like in the attached patch.

- Heikki

Attachment Content-Type Size
0001-Detect-internal-GiST-page-splits-correctly-during-in.patch text/x-patch 4.9 KB
grandparent.sql application/sql 603 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2019-05-07 22:39:01 Re: New EXPLAIN option: ALL
Previous Message Tom Lane 2019-05-07 22:25:12 Re: New EXPLAIN option: ALL