Re: PANIC: wrong buffer passed to visibilitymap_clear - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PANIC: wrong buffer passed to visibilitymap_clear
Date
Msg-id 2691724.1618163730@sss.pgh.pa.us
Whole thread Raw
In response to Re: PANIC: wrong buffer passed to visibilitymap_clear  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PANIC: wrong buffer passed to visibilitymap_clear  (Peter Geoghegan <pg@bowt.ie>)
Re: PANIC: wrong buffer passed to visibilitymap_clear  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
I wrote:
> I'm now inclined to think that we should toss every single line of that
> code, take RelationGetBufferForTuple out of the equation, and have just
> *one* place that rechecks for PageAllVisible having just become set.
> It's a rare enough case that optimizing it is completely not worth the
> code complexity and risk (er, reality) of hard-to-locate bugs.

Alternatively, we could do what you suggested and redefine things
so that one is only allowed to set the all-visible bit while holding
superexclusive lock; which again would allow an enormous simplification
in heap_update and cohorts.  Either way, it's hard to argue that
heap_update hasn't crossed the complexity threshold where it's
impossible to maintain safely.  We need to simplify it.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PANIC: wrong buffer passed to visibilitymap_clear
Next
From: Peter Geoghegan
Date:
Subject: Re: PANIC: wrong buffer passed to visibilitymap_clear