Re: Remaining references to RecentGlobalXmin - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Remaining references to RecentGlobalXmin
Date
Msg-id 20210527023003.pjhhq4otycshggec@alap3.anarazel.de
Whole thread Raw
In response to Remaining references to RecentGlobalXmin  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi,

On 2021-05-24 15:47:48 +0900, Michael Paquier wrote:
> dc7420c2 has removed RecentGlobalXmin, but there are still references
> to it in the code, and a set of FIXME references, like this one in
> autovacuum.c (three in total):
> /*
>  * Start a transaction so we can access pg_database, and get a snapshot.
>  * We don't have a use for the snapshot itself, but we're interested in
>  * the secondary effect that it sets RecentGlobalXmin.  (This is critical
>  * for anything that reads heap pages, because HOT may decide to prune
>  * them even if the process doesn't attempt to modify any tuples.)
>  *
>  * FIXME: This comment is inaccurate / the code buggy. A snapshot that is
>  * not pushed/active does not reliably prevent HOT pruning (->xmin could
>  * e.g. be cleared when cache invalidations are processed).
>  */
> 
> Wouldn't it be better to clean up that?

Sure, but the real cleanup necessary isn't to remove the reference to
RecentGlobalXmin nor specific to 14. It's that the code isn't right, and
hasn't been for a long time.
https://www.postgresql.org/message-id/20200407072418.ccvnyjbrktyi3rzc%40alap3.anarazel.de

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: Speed up pg_checksums in cases where checksum already set
Next
From: Ajin Cherian
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions