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: Consider triggering VACUUM failsafe during scan.
Date: Tue, 25 May 2021 00:14:27 +0000
Message-ID: <E1llKiJ-0005BW-BW@gemulon.postgresql.org> (raw)

Consider triggering VACUUM failsafe during scan.

The wraparound failsafe mechanism added by commit 1e55e7d1 handled the
one-pass strategy case (i.e. the "table has no indexes" case) by adding
a dedicated failsafe check.  This made up for the fact that the usual
one-pass checks inside lazy_vacuum_all_indexes() cannot ever be reached
during a one-pass strategy VACUUM.

This approach failed to account for two-pass VACUUMs that opt out of
index vacuuming up-front.  The INDEX_CLEANUP off case in the only case
that works like that.

Fix this by performing a failsafe check every 4GB during the first scan
of the heap, regardless of the details of the VACUUM.  This eliminates
the special case, and will make the failsafe trigger more reliably.

Author: Peter Geoghegan <pg@bowt.ie>
Reported-By: Andres Freund <andres@anarazel.de>
Reviewed-By: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/20210424002921.pb3t7h6frupdqnkp@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c242baa4a831ac2e7dcaec85feb410aefa3a996e

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 43 ++++++++++++++++--------------------
1 file changed, 19 insertions(+), 24 deletions(-)



Message-ID: <E1llKiJ-0005BW-BW@gemulon.postgresql.org>
Permalink:  ../E1llKiJ-0005BW-BW@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1llKiJ-0005BW-BW@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: Consider triggering VACUUM failsafe during scan.
  In-Reply-To: <E1llKiJ-0005BW-BW@gemulon.postgresql.org>
  References: <E1llKiJ-0005BW-BW@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