pgsql: Notice that heap page has dead items during VACUUM.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Notice that heap page has dead items during VACUUM.
Date: 2021-03-15 01:07:42
Message-ID: E1lLbhu-0007u6-FN@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Notice that heap page has dead items during VACUUM.

Consistently set a flag variable that tracks whether the current heap
page has a dead item during lazy vacuum's heap scan. We missed the
common case where there is an preexisting (or even a new) LP_DEAD heap
line pointer.

Also make it clear that the variable might be affected by an existing
line pointer, say from an earlier opportunistic pruning operation. This
distinction is important because it's the main reason why we can't just
use the nearby tups_vacuumed variable instead.

No backpatch. In theory failing to set the page level flag variable had
no consequences. Currently it is only used to defensively check if a
page marked all visible has dead items, which should never happen anyway
(if it does then the table must be corrupt).

Author: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Diagnosed-By: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAD21AoAtZb4+HJT_8RoOXvu4HM-Zd4HKS3YSMCH6+-W=bDyh-w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0ea71c93a06ddc38e0b72e48f1d512e5383a9c1b

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

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2021-03-15 04:14:16 pgsql: Make archiver process an auxiliary process.
Previous Message Tom Lane 2021-03-13 16:10:36 pgsql: Doc: add note about how to run the pg_amcheck regression tests.