Re: Proposal: Log inability to lock pages during vacuum

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: Log inability to lock pages during vacuum
Date: 2014-12-18 22:05:23
Message-ID: 54934FA3.2040208@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/18/14, 3:02 PM, Alvaro Herrera wrote:
> Andres Freund wrote:
>> On 2014-12-18 16:41:04 -0300, Alvaro Herrera wrote:
>>> + if (scan_all)
>>> + appendStringInfo(&buf, _("waited for %d buffer pins\n"),
>>> + vacrelstats->pinned_pages);
>>> + else
>>> + appendStringInfo(&buf,
>>> + _("skipped %d pages due to buffer pins\n"),
>>> + vacrelstats->pinned_pages);
>>
>> Unless I miss something this is, as mentioned before, not
>> correct. scan_all doesn't imply at all that we waited for buffer
>> pins. We only do so if lazy_check_needs_freeze(buf). Which usually won't
>> be true for a *significant* number of pages.
>
> Ah, interesting, I didn't remember we had that. I guess one possible
> tweak is to discount the pages we skip from pinned_pages; or we could
> keep a separate count of pages waited for. Jim, up for a patch?

I would prefer that we at least count if we initially don't get the lock; presumably that number is always low anyway and in that case I think we're done with this. If it turns out it is common to initially miss the pin then we could do something fancier.

So how about if in the scan_all case we say something like "unable to initially acquire pin on %d buffers\n"?

(Happy to do the patch either way, but I'd like us to decide what we're doing first. ;)
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2014-12-18 23:00:08 Re: hash_create API changes (was Re: speedup tidbitmap patch: hash BlockNumber)
Previous Message Jim Nasby 2014-12-18 21:21:22 Re: Commitfest problems