Re: Adding further hardening to nbtree page deletion - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Adding further hardening to nbtree page deletion
Date
Msg-id 20230621053924.l7az2rkoewiv74pv@awork3.anarazel.de
Whole thread Raw
In response to Adding further hardening to nbtree page deletion  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: Adding further hardening to nbtree page deletion
List 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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Assert while autovacuum was executing
Next
From: Andres Freund
Date:
Subject: Re: Remove deprecation warnings when compiling PG ~13 with OpenSSL 3.0~