Skip site navigation (1) Skip section navigation (2)

Re: Re: [COMMITTERS] pgsql: Start background writer during archive recovery.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Start background writer during archive recovery.
Date: 2009-02-19 20:28:31
Message-ID: 499DC0EF.9040603@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
Tom Lane wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>> Tom Lane wrote:
>>> Maybe the postmaster should wait for startup process exit before
>>> deciding to open for business, instead of just a signal.
> 
>> Not a bad idea. Although, there's nothing wrong with the current way 
>> either. The startup process does a proc_exit(0) right after sending the 
>> signal ATM, so there's no real work left at that point.
> 
> The thing wrong with it is assuming that nothing interesting will happen
> during proc_exit().  We hang enough stuff on on_proc_exit hooks that
> that seems like a pretty shaky assumption.

I can't get too worried, given that proc_exit() is a very well-beaten 
code path. Admittedly not so much for an auxiliary process, but that's 
just a dumbed down version of what happens with a full-blown backend.

However I started looking into that idea anyway, and figured that it 
does simplify the logic in postmaster.c quite a bit, so I think it's 
worth doing on those grounds alone. Attached is a patch against CVS HEAD 
and also against a snapshot before the recovery infra patch, for easier 
reading. I'll give that some more testing and commit if I find no issues.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Attachment: wait-for-startup-to-die-1-against-old-code.patch
Description: text/x-diff (13.5 KB)
Attachment: wait-for-startup-to-die-1.patch
Description: text/x-diff (15.4 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2009-02-19 20:33:40
Subject: Re: graph representation of data structures in optimizer
Previous:From: Adriano LangeDate: 2009-02-19 20:17:54
Subject: Re: graph representation of data structures in optimizer

pgsql-committers by date

Next:From: Tom LaneDate: 2009-02-19 20:32:45
Subject: pgsql: Improve comments about semijoin implementation strategy, per a
Previous:From: User SasDate: 2009-02-19 18:44:24
Subject: slony1-ctl - slony-ctl: Translation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group