Re: autovacuum launcher using InitPostgres

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: autovacuum launcher using InitPostgres
Date: 2009-09-01 08:13:54
Message-ID: 9837222c0909010113i715364e9kbb5d981c5b231bd4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 31, 2009 at 21:49, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>> Tom Lane wrote:
>>> Well, I'm not sure the average user knows or cares about the difference
>>> between the launcher and the workers.  The thing that was in the back of
>>> my mind was that we would now have the option to have the launcher show
>>> up in pg_stat_activity.  If we were to do that then the case for
>>> counting it in the user-visible number-of-processes parameter would get
>>> a lot stronger (enough to justify renaming the parameter, if you insist
>>> that the launcher isn't a worker).  I don't however have any strong
>>> opinion on whether we *should* include it in pg_stat_activity ---
>>> comments?
>
>> The user may not care about the difference, but there's a point in
>> having the limit be the simpler concept of "this is the maximum amount
>> of processes running vacuum at any time".  The launcher is very
>> uninteresting to users.
>
> I committed things that way, but I'm still not convinced that we
> shouldn't expose the launcher in pg_stat_activity.  The thing that
> is bothering me is that it is now able to take locks and potentially
> could block some other process or even participate in a deadlock.
> Do we really want to have entries in pg_locks that don't match any
> entry in pg_stat_activity?

At first I'd have voted that we don't have it in pg_stat_activity, but
the argument about pg_locks really is the killer on. IMHO, it *has* to
go there then.

I would also suggest that we add a separate column to pg_stat_activity
indicating what type of process it is, so that monitoring tools can
figure that out without having to resort to string matching on the
current query field. This field would indicate if it's a backend,
autovac worker, autovac launcher. And perhaps we should even add the
other utility processes to pg_stat_activity, for completeness?

Another thought along a similar line is some way to detect the idle
and idle-in-transaction states without doing string matching as well.
Perhaps this could be overloaded on said extra field, or should it
have a separate one?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2009-09-01 09:16:23 Re: binary compat
Previous Message Dimitri Fontaine 2009-09-01 07:45:35 binary compat