Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Pawel Kudzia <kudzia(at)gmail(dot)com>
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows
Date: 2021-07-13 22:25:13
Message-ID: 06cedb17-6cbe-6586-caa6-2ff618a35517@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 12/07/2021 20:24, Pawel Kudzia wrote:
> i've run these two commands:
>
> SET enable_seqscan=off;
> SELECT entity_id FROM entity WHERE ( attribute_name_ids && '{1737}' )
> AND NOT ( (attribute_name_ids||0) && '{1737}') LIMIT 10;
>
> and got this in the output:
>
> 2021-07-12 07:41:05 UTC LOG: GINBUG: startScanKey called: excludeOnly
> 0 nentries 1
>
> 2021-07-12 07:41:05 UTC STATEMENT: SELECT entity_id FROM entity WHERE
> ( attribute_name_ids && '{1737}' ) AND NOT ( (attribute_name_ids||0)
> && '{1737}') LIMIT 10;
> 2021-07-12 07:41:05 UTC LOG: GINBUG: called triConsistentFn(1): 1 0
>
>
> the "STATEMENT" line is repeated 79586 times, the "GINBUG: called
> triConsistentFn" - 79585 times.
>
> there's nothing else in the log besides information about server startup.
>
> i'll be happy to help with the follow up checks.

Ok, that confirms that it's taking the simple path through
triConsistentFn(), with a single non-lossy key. Also, there don't seem
to be any pending inserts. Now that we've ruled those out, I have no
clue what the problem might be.

Is the data sensitive, or you could you share it? I realize it's a
pretty large database, but if I had a copy I could poke around to look
at the index pages involved here, to see if they're corrupt and how. If
that's possible, you can contact me directly, off-list, to figure the
logistics to send over a copy of the data directory.

- Heikki

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2021-07-13 23:02:46 Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows
Previous Message Tom Lane 2021-07-13 20:41:01 Re: BUG #16583: merge join on tables with different DB collation behind postgres_fdw fails