pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: alexey.ermakov@dataegret.com
Subject: BUG #17268: Possible corruption in toast index after reindex index concurrently
Date: Wed, 03 Nov 2021 08:20:04 +0000
Message-ID: <17268-d2fb426e0895abd4@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17268
Logged by:          Alexey Ermakov
Email address:      alexey.ermakov@dataegret.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@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@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



view thread (28+ messages)  latest in thread

Message-ID: <17268-d2fb426e0895abd4@postgresql.org>
Permalink:  ../17268-d2fb426e0895abd4@postgresql.org/
Also on:    postgresql.org/message-id/17268-d2fb426e0895abd4@postgresql.org

 · 

reply

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, alexey.ermakov@dataegret.com
  Subject: Re: BUG #17268: Possible corruption in toast index after reindex index concurrently
  In-Reply-To: <17268-d2fb426e0895abd4@postgresql.org>

* 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