Re: Missing increment of vacrelstats->pinskipped_pages

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: jim(at)nasby(dot)net
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Missing increment of vacrelstats->pinskipped_pages
Date: 2017-03-29 02:10:02
Message-ID: 20170329.111002.143654088.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

At Tue, 28 Mar 2017 14:15:06 -0400, Jim Nasby <jim(at)nasby(dot)net> wrote in <61de5a80-2ffd-6b05-61e4-210fcb2998aa(at)nasby(dot)net>
> lazy_vacuum_heap() does not count pages that it skips due to not
> obtaining the buffer cleanup lock. vacuum_pinskipped.patch fixes
> that. That should be backpatched to 9.5.
>
> vacuum_comment.patch cleans up a comment in lazy_scan_heap().

> --- a/src/backend/commands/vacuumlazy.c
> +++ b/src/backend/commands/vacuumlazy.c
> @@ -1404,6 +1404,7 @@ lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats)
> if (!ConditionalLockBufferForCleanup(buf))
> {
> ReleaseBuffer(buf);
> + vacrelstats->pinskipped_pages++;
> ++tupindex;
> continue;

This is within a dead-tuple removal loop so pinskipped pages
shouldn't be increment here. If several dead-tuples are in a
page, the page will be counted as many times as the number of the
tuples.

On the contrary, the page must not have been skipped since the
dead tuples are the result of a scan on the page.

The skipped *tuples* just remain dead and shown as "# dead row
versios cannot be removed yet".

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-03-29 02:53:47 Re: On How To Shorten the Steep Learning Curve Towards PG Hacking...
Previous Message Peter Eisentraut 2017-03-29 02:06:21 Re: cast result of copyNode()