Re: Reading recovery.conf earlier - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Reading recovery.conf earlier
Date
Msg-id 1260174486.13774.46671.camel@ebony
Whole thread Raw
In response to Re: Reading recovery.conf earlier  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Reading recovery.conf earlier  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: Reading recovery.conf earlier  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Mon, 2009-12-07 at 10:13 +0200, Heikki Linnakangas wrote:
> Simon Riggs wrote:
> > What postgresql.conf already does is read file separately in each
> > process, so no data passing.
> 
> No it doesn't. Postmaster reads the file once, and backends inherit the
> values at fork(). In EXEC_BACKEND case, postmaster writes all the
> non-default values to a separate file, which the child process reads at
> startup.

As I mentioned, the difficulty is always the Windows case. I wasn't
aware we wrote a separate file in that case, so that does potentially
effect my thinking.

> Reading the file separately in each process would cause trouble with
> PGC_POSTMASTER params. All backends must agree on their values.

Looking at the parameters in recovery.conf I don't believe they would
cause problems if read twice. So I think reading file twice would still
be simplest way forwards.

If you really think that changing the file is a possibility between
processes reading them, then I would just take a full temp copy of the
file, read it in postmaster, read it in startup, then delete temp file.

-- Simon Riggs           www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Hitoshi Harada
Date:
Subject: Re: YAML Was: CommitFest status/management
Next
From: Simon Riggs
Date:
Subject: Re: Hot standby, recent changes