pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Kamigishi Rei <iijima.yun@koumakan.jp>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: Thomas Munro <thomas.munro@gmail.com>
Subject: Re: BUG #17245: Index corruption involving deduplicated entries
Date: Fri, 29 Oct 2021 13:18:48 -0700
Message-ID: <20211029201848.zixfp5wk2hvkeaq2@alap3.anarazel.de> (raw)
In-Reply-To: <399affa1-c9c5-9b3e-c14f-b24ecb86b303@koumakan.jp>
References: <202110250104.jve5vzdedck7@alvherre.pgsql>
	<87h7d57b3q.fsf@news-spur.riddles.org.uk>
	<20211028214209.kbv4ulehz36up6kq@alap3.anarazel.de>
	<125603c4-4403-dcbb-221e-fd1d4ef6ed83@koumakan.jp>
	<20211028220124.n4vulzxp6i6fsq4t@alap3.anarazel.de>
	<551936fa-9ba8-aed1-7ae1-c77d5920101c@koumakan.jp>
	<9c7433f6-65b3-9f57-e8a3-4414d0cf0c53@koumakan.jp>
	<399affa1-c9c5-9b3e-c14f-b24ecb86b303@koumakan.jp>

Hi,

On 2021-10-29 22:52:39 +0300, Kamigishi Rei wrote:
> On 29.10.2021 21:36, Kamigishi Rei wrote:
> > btree index "azurlane_wiki.mediawiki.page_main_title":
> >     ERROR:  item order invariant violated for index "page_main_title"
> >     DETAIL:  Lower index tid=(17,157) (points to heap tid=(540,5))
> > higher index tid=(17,158) (points to heap tid=(540,5)) page
> > lsn=2/A019DD78.
> 
> I forgot to include WAL archive grepped for the "page" table's heap page
> 540. Note that 540,5 is mentioned below just before VACUUM. `SELECT h.* FROM
> heap_page_items(get_raw_page('page',540)) h;` returns lp_flags=3 for lp=5
> for the snapshot (though I am not sure if lp=5 here is the same 5 as in the
> tid=(540,5) tuple).

Could you search for btree WAL records before the following records? Most
importantly for the corrupted page in the corrupted index, but other ones
might be interesting as well

> rmgr: Heap2       len (rec/tot):     53/  7937, tx:          0, lsn:
> 2/90CEF528, prev 2/90CEF4E8, desc: VACUUM nunused 3, blkref #0: rel
> 1663/19243/19560 blk 540 FPW
> rmgr: Heap2       len (rec/tot):     53/  8109, tx:          0, lsn:
> 2/97ED2598, prev 2/97ED2558, desc: VACUUM nunused 1, blkref #0: rel
> 1663/19243/19560 blk 540 FPW

The currently most likely seeming explanation is that somehow the index
entries pointing to the heap items removed here weren't removed
themselves. Subsequently leading to visible corruption once those tids are
reused.

Greetings,

Andres Freund





view thread (103+ messages)  latest in thread

Message-ID: <20211029201848.zixfp5wk2hvkeaq2@alap3.anarazel.de>
Permalink:  ../20211029201848.zixfp5wk2hvkeaq2@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20211029201848.zixfp5wk2hvkeaq2@alap3.anarazel.de

 · 

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: andres@anarazel.de, iijima.yun@koumakan.jp, andrew@tao11.riddles.org.uk, alvherre@alvh.no-ip.org, pg@bowt.ie, pgsql-bugs@lists.postgresql.org, thomas.munro@gmail.com
  Subject: Re: BUG #17245: Index corruption involving deduplicated entries
  In-Reply-To: <20211029201848.zixfp5wk2hvkeaq2@alap3.anarazel.de>

* 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