From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum
Date: Fri, 04 Feb 2022 10:15:21 -0500
Message-ID: <391181.1643987721@sss.pgh.pa.us> (raw)
In-Reply-To: <20220204041935.gf4uwbdxddq6rffh@alap3.anarazel.de>
References: <CAH2-Wz=w6wVbat4B=HQTzim5ki=NyPhT6FxWPST=tN2+BjHrpw@mail.gmail.com>
<20211122175914.ayk6gg6nvdwuhrzb@alap3.anarazel.de>
<CAH2-Wzk+=kCS5SMMQ++s5vX9NmWKxJmOBfU2wqR-n78cOYFgfA@mail.gmail.com>
<20211122223436.ov3qa27pakxay6z7@alap3.anarazel.de>
<20211211045710.ljtuu4gfloh754rs@alap3.anarazel.de>
<CAH2-WzkNr0t2e9Vr8T8QZNzA1Vze9C7s5-=61nhz2gHAooW05Q@mail.gmail.com>
<20220112192508.vibr6o64h7sy7mbw@alap3.anarazel.de>
<CAH2-WzkuGdm6-7euVQaGBK=BD6sOZJckgnkx3XWwYNB_ysjGbQ@mail.gmail.com>
<20220114021549.m6ugihzjmsunv3jd@alap3.anarazel.de>
<294529.1643921668@sss.pgh.pa.us>
<20220204041935.gf4uwbdxddq6rffh@alap3.anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> On 2022-02-03 15:54:28 -0500, Tom Lane wrote:
>> I'm writing release notes and wondering what I can tell users about
>> how to detect or recover from this bug. Is a REINDEX sufficient,
>> or is the presence of the bogus redirect item going to cause
>> persistent problems?
> Good questions.
> It's hard to answer whether there's any danger after a REINDEX. Afaics the
> build scan would just pick the "lower offset" version of the root
> pointer. Which should be fine.
> It's possible there could be trouble down the line, e.g. heap pruning doing
> something weird once starting in a corrupted state, that then leads REINDEX to
> do something bogus. The simple cases look OK, because a second visit/action by
> heap_prune_chain for one tid from two different root pointers would see
> ->marked[offnum] as true. It gets more complicated once multiple intermediary
> row versions are involved, because the intermediary row versions won't be in
> ->marked if an entire chain is pruned. But afaict that should still end up
> looking like a hot chain ending in an aborted tuple or such.
OK, I'll just recommend REINDEX.
> Except that it's not trivial to get right, I could see it being worthwhile to
> add verification of hot chains to amcheck, and backpatch that to 14.
I'd have thought that'd be a fundamental component of a heap check
module, so +1 for adding it. Dunno about the back-patch part though.
It seems like a new feature.
regards, tom lane
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: tgl@sss.pgh.pa.us, andres@anarazel.de, pg@bowt.ie, 9erthalion6@gmail.com, exclusion@gmail.com, boekewurm+postgres@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum
In-Reply-To: <391181.1643987721@sss.pgh.pa.us>
* 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