Re: Avoiding another needless ERROR during nbtree page deletion

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Avoiding another needless ERROR during nbtree page deletion
Date: 2023-05-22 17:59:59
Message-ID: CAH2-Wz=eEpZAvauzu2a2ObwXotJW1GcqdQLdAdE1+NO6990opA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 22, 2023 at 9:22 AM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> > This comment notes that this is similar to what we did with the left
> > sibling, but there isn't really any mention at the left sibling code
> > about avoiding hard ERRORs. Feels a bit backwards. Maybe move the
> > comment about avoiding the hard ERROR to where the left sibling is
> > handled. Or explain it in the function comment and just have short
> > "shouldn't happen, but avoid hard ERROR if the index is corrupt" comment
> > here.
>
> Good point. Will do it that way.

Attached is v2, which does it that way. It also adjusts the approach
taken to release locks and pins when the left sibling validation check
fails. This makes it simpler and more consistent with surrounding
code. I might not include this change in the backpatch.

Not including a revised amcheck patch here, since I'm not exactly sure
what to do with your feedback on that one just yet.

--
Peter Geoghegan

Attachment Content-Type Size
v2-0001-nbtree-VACUUM-cope-with-right-sibling-link-corrup.patch application/octet-stream 6.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2023-05-22 18:01:29 Re: PG 16 draft release notes ready
Previous Message Andres Freund 2023-05-22 17:59:36 Re: PG 16 draft release notes ready