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

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Maxim Boguk <maxim.boguk@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>, Alexey Ermakov <alexey.ermakov@dataegret.com>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>, Michael Paquier <michael@paquier.xyz>
Date: 2021-11-08T17:51:13Z
Lists: pgsql-bugs
Hi,

On 2021-11-04 20:07:28 +0200, Maxim Boguk wrote:
> ERROR:  heap tuple (59561917,1) from table "pg_toast_2624976286" lacks
> matching index tuple within index "pg_toast_2624976286_index"
> HINT:  Retrying verification using the function
> bt_index_parent_check() might provide a more specific error.

Could you use https://www.postgresql.org/docs/devel/pageinspect.html
to get the heap items for this page? Best after verifying that that ctid still
shows an amcheck error. Something like

SELECT * FROM page_header(get_raw_page('pg_toast_2624976286', 59561917));
SELECT lp, lp_off, lp_flags, lp_len, t_xmin, t_xmax, t_field3, t_ctid, t_infomask2, t_infomask, mask.raw_flags, mask.combined_flags, t_hoff, t_bits
FROM heap_page_items(get_raw_page('pg_toast_2624976286', 59561917)),
  heap_tuple_infomask_flags(t_infomask, t_infomask2) AS mask;

Do you have WAL archiving or such set up? If you still have the WAL from that
time it'd be helpful.

Greetings,

Andres Freund



Commits

  1. Fix corruption of toast indexes with REINDEX CONCURRENTLY