Re: bug in SignalSomeChildren

Alvaro Herrera <alvherre@commandprompt.com>

From: Alvaro Herrera <alvherre@commandprompt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Fujii Masao <masao.fujii@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-12-17T16:27:23Z
Lists: pgsql-hackers
Excerpts from Tom Lane's message of vie dic 17 13:18:35 -0300 2010:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Is it possible to save the "is walsender" flag in the Backend struct?
> > That would make it possible to solve the problem very easily.
> 
> Yeah, I was wondering about that too, but the problem is that the
> postmaster doesn't know that at the time it forks the child.  The
> flag in shared memory will get set later, but it's hard to tell
> how much later.

Yeah, I arrived at the same conclusion.  I was wondering if we could
cache the result of the shared mem lookup the first time it was done,
but as you say there would still be a race condition.

> I think what we ought to be looking to do is get rid of the distinction,
> so that the postmaster treats walsenders the same as other children.

I think the problem with this is that walsenders are treated in a very
special way during shutdown -- they need to stay up until after bgwriter
is gone.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support