Re: Proposal: Log inability to lock pages during vacuum

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, 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: 2015-01-04 00:53:24
Message-ID: 20150104005324.GC9626@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-12-18 16:05:23 -0600, Jim Nasby wrote:
> 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.

Also, naming the number of pages we could *not* pin, pinned_pages?
Really?

pinskipped_pages,skipped_pages,unpinned_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?

This is still wrong. I think just counting skipped pages, without
distinct messages for waiting/not waiting, is good enough for
now. Everything else would only be actually meaningful if we actually
tracked the waiting time.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-01-04 00:56:06 Re: Small doc patch about pg_service.conf
Previous Message Andres Freund 2015-01-04 00:39:02 Re: Possible micro-optimization in CacheInvalidateHeapTuple