From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hari Babu <haribabu.kommi@huawei.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7643: Issuing a shutdown request while server startup leads to server hang
Date: Tue, 20 Nov 2012 16:00:29 -0500
Message-ID: <14768.1353445229@sss.pgh.pa.us> (raw)
In-Reply-To: <005201cdc6d7$fb988f00$f2c9ad00$@kommi@huawei.com>
References: <E1TWWd4-0008AD-9E@wrigleys.postgresql.org>
<10253.1353353527@sss.pgh.pa.us>
<005201cdc6d7$fb988f00$f2c9ad00$@kommi@huawei.com>
Hari Babu <haribabu.kommi@huawei.com> writes:
>> We're going to need more details about how to reproduce this.
> The problem occurs only when active server is restarting by just adding a
> recovery.conf file to the data directory.
Well, you can't just put an empty file there, but I eventually managed
to reproduce this with the suggested hack in xlog.c.
I think the key problem is that postmaster.c's sigusr1_handler() is
willing to start new children even after shutdown has been initiated.
I don't see any good reason for it to do that, so I think the
appropriate patch is as attached.
Changing that still leaves us with the postmaster thinking that the
eventual exit(1) of the startup process is a "crash". This is mostly
cosmetic since it still shuts down okay, but we can fix it by reversing
the order of the first two checks in reaper() --- that is, if Shutdown
is set, we should prefer that code path even if we're in PM_STARTUP
state.
I concluded that it probably wasn't a good idea to have the additional
state transition in SIGINT handling. Generally PM_STARTUP means "we're
running the startup process and nothing else", and that's useful state
info that we shouldn't throw away lightly.
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, haribabu.kommi@huawei.com
Subject: Re: BUG #7643: Issuing a shutdown request while server startup leads to server hang
In-Reply-To: <14768.1353445229@sss.pgh.pa.us>
References: <E1TWWd4-0008AD-9E@wrigleys.postgresql.org> <10253.1353353527@sss.pgh.pa.us> <005201cdc6d7$fb988f00$f2c9ad00$@kommi@huawei.com> <14768.1353445229@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