Re: Adding further hardening to nbtree page deletion

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Adding further hardening to nbtree page deletion
Date: 2023-06-21 05:39:24
Message-ID: 20230621053924.l7az2rkoewiv74pv@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2023-06-16 14:15:08 -0700, Peter Geoghegan wrote:
> Attached patch adds additional hardening to nbtree page deletion. It
> makes nbtree VACUUM tolerate a certain sort of cross-page
> inconsistencies in the structure of an index (corruption). VACUUM can
> press on, avoiding an eventual wraparound/xidStopLimit failure in
> environments where nobody notices the problem for an extended period.
>
> This is very similar to my recent commit 5abff197 (though it's even
> closer to commit 5b861baa). Once again we're demoting an ERROR to a
> LOG message, and pressing on with vacuuming. I propose that this patch
> be backpatched all the way, too. The hardening added by the patch
> seems equally well targeted and low risk. It's a parent/child
> inconsistency, as opposed to a sibling inconsistency. Very familiar
> stuff, overall.
>
> [...]
>
> At the time the ERROR was a PANIC. A few years later (in 2010), it was
> demoted to an ERROR (see commit 8fa30f90). And now I want to demote it
> to a LOG -- which is much easier now that we have a robust approach to
> page deletion (after 2014 commit efada2b8e9).

I have no objection to this concrete change (nor have I reviewed it
carefully).

But the further we go down this path, the more important it is that we provide
some way to monitor stuff like this. IME it's not particularly practical to
rely on scanning logs to find such issues at scale. I suspect we ought to add
at least something that makes such "ignored errors" visible from stats.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-06-21 05:44:59 Re: Remove deprecation warnings when compiling PG ~13 with OpenSSL 3.0~
Previous Message Andres Freund 2023-06-21 05:27:13 Re: Assert while autovacuum was executing