Re: pgsql: Avoid improbable PANIC during heap_update. - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Avoid improbable PANIC during heap_update.
Date
Msg-id 869716.1664599080@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Avoid improbable PANIC during heap_update.  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: pgsql: Avoid improbable PANIC during heap_update.
List pgsql-committers
Peter Geoghegan <pg@bowt.ie> writes:
> ... nothing stops heap_delete() from getting a pin
> on a heap page that happens to have already been cleanup locked by
> another session running VACUUM. The same session could then
> (correctly) observe that the page does not have PD_ALL_VISIBLE set --
> not yet. VACUUM might then set PD_ALL_VISIBLE, without having to
> acquire any kind of interlock that heap_delete() will reliably notice.

I'm too tired to think this through completely clearly, but this
sounds right, and what it seems to imply is that this race condition
exists in all PG versions.  Which would imply that we need to do the
work to back-patch these three fixes into v11/v10.  I would rather
not do that, because then we'd have to also back-patch some other
more-invasive changes, and the net risk of introducing new bugs
seems uncomfortably high.  (Especially for v10, where there will
be no second chance after the November releases.)

So what is bothering me about this line of thought is: how come
there have not been reports of these failures in older branches?
Is there some aspect we're not thinking about that masks the bug?

            regards, tom lane



pgsql-committers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: pgsql: Avoid improbable PANIC during heap_update.
Next
From: Peter Geoghegan
Date:
Subject: Re: pgsql: Avoid improbable PANIC during heap_update.