Re: BUG #17245: Index corruption involving deduplicated entries

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Kamigishi Rei <iijima(dot)yun(at)koumakan(dot)jp>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Peter Geoghegan <pg(at)bowt(dot)ie>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: BUG #17245: Index corruption involving deduplicated entries
Date: 2021-10-29 18:50:32
Message-ID: 202110291850.cxcsg7j7ye6r@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2021-Oct-29, Kamigishi Rei wrote:

> The weird part about this is that the WAL archive does not seem to contain
> any data for 157 and 158 above (in 1663/19243/274869 blk 17). The last two
> entries are
>
> rmgr: Btree       len (rec/tot):     53/  4885, tx:    2085600, lsn:
> 2/A0195AE0, prev 2/A01943F0, desc: INSERT_LEAF off 155, blkref #0: rel
> 1663/19243/274869 blk 17 FPW
> rmgr: Btree       len (rec/tot):     72/    72, tx:    2085602, lsn:
> 2/A019DD30, prev 2/A019DCF0, desc: INSERT_LEAF off 156, blkref #0: rel
> 1663/19243/274869 blk 17
>
> The WAL file in data14/pg_wal does not have anything related to 157 and 158
> for this filenode/blk as well.

Hmm, I don't remember precisely how index tuple removal works, but maybe
these 157 and 158 entries existed previously and were truncated away.
It might be useful to have a look at the page header in the page image
contained in the FPW for 2/A0195AE0.

pg_waldump doesn't do it, but I have this patch sitting around ...
probably outdated, but it may be a useful starting point for somebody.

--
Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/

Attachment Content-Type Size
waldump-save-fpi.patch text/x-diff 2.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2021-10-29 18:52:02 Re: BUG #17245: Index corruption involving deduplicated entries
Previous Message David G. Johnston 2021-10-29 18:47:57 Re: BUG #17258: Unexpected results in CHAR(1) data type