Re: Better way of dealing with pgstat wait timeout during buildfarm runs?

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Better way of dealing with pgstat wait timeout during buildfarm runs?
Date: 2015-01-18 18:19:33
Message-ID: 20150118181933.GA3090613@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 27, 2014 at 07:55:05PM -0500, Tom Lane wrote:
> To get back to that original complaint about buildfarm runs failing,
> I notice that essentially all of those failures are coming from "wait
> timeout" warnings reported by manual VACUUM commands. Now, VACUUM itself
> has no need to read the stats files. What's actually causing these
> messages is failure to get a timely response in pgstat_vacuum_stat().
> So let me propose a drastic solution: let's dike out this bit in vacuum.c:
>
> /*
> * Send info about dead objects to the statistics collector, unless we are
> * in autovacuum --- autovacuum.c does this for itself.
> */
> if ((vacstmt->options & VACOPT_VACUUM) && !IsAutoVacuumWorkerProcess())
> pgstat_vacuum_stat();
>
> This would have the effect of transferring all responsibility for
> dead-stats-entry cleanup to autovacuum. For ordinary users, I think
> that'd be just fine. It might be less fine though for people who
> disable autovacuum, if there still are any.

Like Robert, I don't care for that.

> Or, much more simply, we could conclude that it's not that important
> if pgstat_vacuum_stat() is unable to get up-to-date stats, and rejigger
> the code so that we don't bleat when the file-reading request comes from
> that source. This should be a back-patchable fix, whereas #2 above might
> be a bit too complicated for that.

This, however, feels like a clear improvement. When every VACUUM does
pgstat_vacuum_stat(), it doesn't matter if any given VACUUM misses removing
entries that became obsolete in the preceding second or so. In fact, rather
than merely not bleating when the wait times out, let's not wait at all. I
don't favor VACUUM of a small table taking 12s because it spent 2s on the
table and 10s waiting to garbage collect a piping-hot stats file.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2015-01-18 19:30:46 Re: proposal: row_to_array function
Previous Message David Fetter 2015-01-18 17:38:54 Re: [REVIEW] Re: Fix xpath() to return namespace definitions