From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <stark@mit.edu>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Order of operations in SubPostmasterMain()
Date: Thu, 29 Sep 2016 16:32:44 -0400
Message-ID: <7430.1475181164@sss.pgh.pa.us> (raw)
In-Reply-To: <CAM-w4HPEK01i6HFN5reT=azFJYsfLLUsTZa-783_Q6EKCfAmjg@mail.gmail.com>
References: <4157.1475178360@sss.pgh.pa.us>
<CAM-w4HPEK01i6HFN5reT=azFJYsfLLUsTZa-783_Q6EKCfAmjg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Greg Stark <stark@mit.edu> writes:
> On Thu, Sep 29, 2016 at 8:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> We could probably refactor things enough so that we do pq_init()
>> before PGSharedMemoryReAttach(). It would be a little bit ugly,
>> and it would fractionally increase the chance of a reattach failure
>> because pq_init() palloc's a few KB worth of buffers. I'm not quite
>> sure if it's worth it; thoughts? In any case the mentioned comments
>> are obsolete and need to be moved/rewritten.
> Alternately we could call pq_init in the error path if it hasn't been
> called yet. I'm sure there are problems with doing that in general but
> for the specific errors that can happen before pq_init it might be
> feasible since they obviously can't have very much shared state yet to
> have corrupted.
Thanks for the suggestion, but I don't think it helps much. Most of
the refactoring pain comes from the fact that we'd have to set up
MyProcPort earlier (since pqcomm.c needs that to be valid), and
it's not very clear just where to do that. Having pq_init be called
behind the scenes does nothing to fix that issue.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, stark@mit.edu
Subject: Re: Order of operations in SubPostmasterMain()
In-Reply-To: <7430.1475181164@sss.pgh.pa.us>
References: <4157.1475178360@sss.pgh.pa.us> <CAM-w4HPEK01i6HFN5reT=azFJYsfLLUsTZa-783_Q6EKCfAmjg@mail.gmail.com> <7430.1475181164@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox