Re: Review: Extra Daemons / bgworker - Mailing list pgsql-hackers

From Markus Wanner
Subject Re: Review: Extra Daemons / bgworker
Date
Msg-id 50BCC291.7000201@bluegap.ch
Whole thread Raw
In response to Re: Review: Extra Daemons / bgworker  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Review: Extra Daemons / bgworker  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Review: Extra Daemons / bgworker  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On 12/03/2012 03:28 PM, Alvaro Herrera wrote:
> I'm not really that interested in it currently ... and there are enough
> other patches to review.  I would like bgworkers to mature a bit more
> and get some heavy real world testing before we change autovacuum.

Understood.

>> Just like av_launcher does it now: set a flag in shared memory and
>> signal the postmaster (PMSIGNAL_START_AUTOVAC_WORKER).
> 
> I'm not sure how this works.  What process is in charge of setting such
> a flag?

The only process that currently starts background workers ... ehm ...
autovacuum workers is the autovacuum launcher. It uses the above
Postmaster Signal in autovacuum.c:do_start_autovacuum_worker() to have
the postmaster launch bg/autovac workers on demand.

(And yes, this kind of is an exception to the rule that the postmaster
must not rely on shared memory. However, these are just flags we write
atomically, see pmsignal.[ch])

I'd like to extend that, so that other processes can request to start
(pre-registered) background workers more dynamically. I'll wait for an
update of your patch, though.

> This is actually a very silly bug: it turns out that guc.c obtains the
> count of workers before workers have actually registered.  So this
> necessitates some reshuffling.

Okay, thanks.

Regards

Markus Wanner



pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: [v9.3] OAT_POST_ALTER object access hooks
Next
From: Robert Haas
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL