pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: vacuumlazy.c: document vistest and OldestXmin.
Date: Sat, 12 Mar 2022 20:53:49 +0000
Message-ID: <E1nT8kG-000SoG-Nd@gemulon.postgresql.org> (raw)

vacuumlazy.c: document vistest and OldestXmin.

Explain the relationship between vacuumlazy.c's vistest and OldestXmin
cutoffs.  These closely related cutoffs are different in subtle but
important ways.  Also document a closely related rule: we must establish
rel_pages _after_ OldestXmin to ensure that no XID < OldestXmin can be
missed by lazy_scan_heap().

It's easier to explain these issues by initializing everything together,
so consolidate initialization of vacrel state.  Now almost every vacrel
field is initialized by heap_vacuum_rel().  The only remaining exception
is the dead_items array, which is still managed by lazy_scan_heap() due
to interactions with how we initialize parallel VACUUM.

Also move the process that updates pg_class entries for each index into
heap_vacuum_rel(), and adjust related assertions.  All pg_class updates
now take place after lazy_scan_heap() returns, which seems clearer.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20211211045710.ljtuu4gfloh754rs@alap3.anarazel.de
Discussion: https://postgr.es/m/CAH2-WznYsUxVT156rCQ+q=YD4S4=1M37hWvvHLz-H1pwSM8-Ew@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/73f6ec3d3c8d5786c54373e71a096e5acf78e7ca

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 173 +++++++++++++++++++----------------
1 file changed, 92 insertions(+), 81 deletions(-)



Message-ID: <E1nT8kG-000SoG-Nd@gemulon.postgresql.org>
Permalink:  ../E1nT8kG-000SoG-Nd@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nT8kG-000SoG-Nd@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: pg@bowt.ie
  Subject: Re: pgsql: vacuumlazy.c: document vistest and OldestXmin.
  In-Reply-To: <E1nT8kG-000SoG-Nd@gemulon.postgresql.org>
  References: <E1nT8kG-000SoG-Nd@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox