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: Fix autovacuum log output heap truncation issue.
Date: Thu, 13 May 2021 23:08:51 +0000
Message-ID: <E1lhKRn-0001Dg-Jr@gemulon.postgresql.org> (raw)

Fix autovacuum log output heap truncation issue.

The percentage of blocks from the table value reported by autovacuum log
output (following commit 5100010ee4d) should never exceed 100% because
it describes the state of the table back when lazy_vacuum() was called.
The value could nevertheless exceed 100% in the event of heap relation
truncation.  We failed to compensate for how truncation affects
rel_pages.

Fix the faulty accounting by using the original rel_pages value instead
of the current/final rel_pages value.

Reported-By: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20210423204306.5osfpkt2ggaedyvy@alap3.anarazel.de

Branch
------
master

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

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)



Message-ID: <E1lhKRn-0001Dg-Jr@gemulon.postgresql.org>
Permalink:  ../E1lhKRn-0001Dg-Jr@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lhKRn-0001Dg-Jr@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: Fix autovacuum log output heap truncation issue.
  In-Reply-To: <E1lhKRn-0001Dg-Jr@gemulon.postgresql.org>
  References: <E1lhKRn-0001Dg-Jr@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