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

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: alexey(dot)ermakov(at)dataegret(dot)com
Subject: BUG #17268: Possible corruption in toast index after reindex index concurrently
Date: 2021-11-03 08:20:04
Message-ID: 17268-d2fb426e0895abd4@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17268
Logged by: Alexey Ermakov
Email address: alexey(dot)ermakov(at)dataegret(dot)com
PostgreSQL version: 13.4
Operating system: Ubuntu 18.04.5 LTS
Description:

Hello,

after running this query:
2021-11-02 13:15:45.469 UTC 2379 postgres(at)xx from [local] [vxid:24/0 txid:0]
[REINDEX] LOG: duration: 1719120.441 ms statement: REINDEX INDEX
CONCURRENTLY pg_toast.pg_toast_2624976286_index

we've got following errors (here is first one, others looks exactly the same
with same "toast value"):
2021-11-02 20:37:12.305 UTC 27935 yy(at)xx from [local] [vxid:41/199242673
txid:0] [SELECT] ERROR: missing chunk number 0 for toast value 4040061139
in pg_toast_2624976286

it turns out one entry in toast index (?) was corrupted:
select md5(body) from zz where id = ...;
ERROR: missing chunk number 0 for toast value 4040061139 in
pg_toast_2624976286

According to "created_at" column in linked table row was created at
"2021-11-02 13:04:22.192125", i.e. during reindex concurrently.

I'm wondering if it's known bug and how risky could it be to reindex toast's
indexes. It was done automatically with tool which monitors indexes' bloat
and index size reduced several times in this case.

It's possible to get additional details from backup and WAL archive but
it'll take some time to restore (row with corrupted data was removed).

--
Thanks,
Alexey Ermakov

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fahar Abbas 2021-11-03 10:04:48 Re: help me solve the error
Previous Message Semab Tariq 2021-11-03 08:13:01 Re: help me solve the error