Hi,
On 2022-03-10 21:05:37 -0500, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Another example of complete brokenness in the wider area is catalog accesses
> > happening after PROC_IN_VACUUM is set. Afaict it's entirely incorrect to do
> > any catalog accesses once set, because rows that are still needed for the
> > catalog access can just be removed.
>
> That seems like a fairly untenable design rule. Maybe we should rethink
> what PROC_IN_VACUUM means/is used for.
Isn't it something fairly fundamental? The goal of PROC_IN_VACUUM is to
prevent vacuum from holding up the "horizon" so other vacuums can remove rows
that have become dead after a long vacuum started.
I think we basically have to move the setting of PROC_IN_VACUUM to the last
moment, when we've done everything else, and then force a new snapshot to be
computed after.
Greetings,
Andres Freund