Re: fix bgworkers in EXEC_BACKEND

From: Andres Freund <andres(at)2ndquadrant(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>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fix bgworkers in EXEC_BACKEND
Date: 2012-12-27 23:48:50
Message-ID: 20121227234850.GB31343@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2012-12-27 18:44:57 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > I am still worried about the following scenario in the EXEC_BACKEND case:
>
> > 1) postmaster starts
> > 2) reads config
> > 3) executes _PG_init for shared_preload_libraries
> > 4) library 'abc' gets config value 'abc.num_workers = 2' and registers as many workers
> > 5) some time goes by, workers, backends start
> > 6) abc.num_workers gets changed to 3, SIGHUP
>
> This is broken whether it's EXEC_BACKEND or not: you don't get to change
> anything that determines the number of workers post-startup.
> num_workers should have been declared PGC_POSTMASTER.

Well, the problem is, a shared library can't do that
afaics. abc.num_workers would be using custom_variable_classes (well,
whatever its called now, that it doesn't need to be configured).

There is no predefined 'num_workers' variable or anything like it in the
patch, but I guess some of the module authors will come of up with
configuration variables like that.

I personally want e.g. 'bdr.databases = 'a, b, c' which obviously has
the same problem...

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 anarazel@anarazel.de 2012-12-28 00:28:49 Re: fix bgworkers in EXEC_BACKEND
Previous Message Tom Lane 2012-12-27 23:44:57 Re: fix bgworkers in EXEC_BACKEND