Re: BUG #17268: Possible corruption in toast index after reindex index concurrently

From: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>, Alexey Ermakov <alexey(dot)ermakov(at)dataegret(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: BUG #17268: Possible corruption in toast index after reindex index concurrently
Date: 2021-11-07 20:29:42
Message-ID: CAK-MWwQGv-wjcSrYeGE8fCW0=KYGE1tSMoH-fJ8maWV3kfe9iQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Nov 7, 2021 at 2:07 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> Hi,
>
> On November 4, 2021 1:01:44 PM PDT, Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com> wrote:
> >UPDATE: the problem base table entry which had erroneous toast data
> >definitely had been created during the REINDEX run of toast idx.
>
> Do you have any details about the transaction / application that inserted the data?

Well... jdbc with server side prepared statements off (pgbouncer).

> >2021-11-02 13:15:45.469 UTC 2379 postgres(at)*** from [local] [vxid:24/0
> >txid:0] [REINDEX] LOG: duration: 1719120.441 ms statement: REINDEX
> >INDEX CONCURRENTLY pg_toast.pg_toast_2624976286_index
> >and the problem entry had been created at 2021-11-02 13:04:22.192125 UTC.
> >
> >So there seems some subtle bug with indexing new toast data during
> >REINDEX INDEX CONCURRENTLY of the toast index.
>
> Any chance you're using prepared transactions?

Most definitely no, prepared TS are disabled server-wide.
postgres=# show max_prepared_transactions ;
max_prepared_transactions
---------------------------
0

--
Maxim Boguk
Senior Postgresql DBA
https://dataegret.com/

Phone RU: +7 985 433 0000
Phone UA: +380 99 143 0000
Phone AU: +61 45 218 5678

LinkedIn: http://www.linkedin.com/pub/maksym-boguk/80/b99/b1b
Skype: maxim.boguk

"Доктор, вы мне советовали так не делать, но почему мне по-прежнему
больно когда я так делаю ещё раз?"

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2021-11-07 23:22:02 Re: CREATE INDEX CONCURRENTLY does not index prepared xact's data
Previous Message Justin Pryzby 2021-11-07 19:22:00 Re: pg_upgrade test for binary compatibility of core data types