pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: 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: Mon, 19 Nov 2012 14:32:07 -0500
Message-ID: <10253.1353353527@sss.pgh.pa.us> (raw)
In-Reply-To: <E1TWWd4-0008AD-9E@wrigleys.postgresql.org>
References: <E1TWWd4-0008AD-9E@wrigleys.postgresql.org>

haribabu.kommi@huawei.com writes:
> Problem Reproduction:
> 1. Add recovery.conf to the database directory.
> 2. Start the server
> 3. Issue the shutdown request 
> and the shutdown request timing should be such that below server logs should
> print.

> Log:

> ./postgres -D data -p 3335
> LOG:  database system was shut down in recovery at 2012-11-08 19:42:42 IST
> LOG:  entering standby mode
> LOG:  received fast shutdown request
> LOG:  consistent recovery state reached at 0/17D0700
> LOG:  record with zero length at 0/17D0700

> Problem reproduced in 9.3 head.

After further investigation, I can't reproduce this and I don't believe
your patch fixes it.  What happens when I try this is

* postmaster gets SIGINT, sends SIGTERM to startup process

* startup process exits with exit(1)

* postmaster sees that as a startup crash and exits, per the first
test in reaper()

So the log trace I'm getting looks like

LOG:  received fast shutdown request
LOG:  startup process (PID 9772) exited with exit code 1
LOG:  aborting startup due to startup process failure

Now, transitioning to PM_WAIT_BACKENDS state earlier, as your patch
proposes, might make the log look a bit nicer because the logic in
reaper() wouldn't think the exit was a "crash".  But it's not going to
have anything to do with whether the startup process exits on the signal
or not.  What seems to have happened for you is that the startup process
ignored the SIGTERM signal, but it's not at all obvious why.

We're going to need more details about how to reproduce this.
I speculate it might have something to do with the specific
restore_command you're using.

			regards, tom lane




view thread (8+ messages)  latest in thread

Message-ID: <10253.1353353527@sss.pgh.pa.us>
Permalink:  ../10253.1353353527@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10253.1353353527@sss.pgh.pa.us

 · 

reply

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: <10253.1353353527@sss.pgh.pa.us>
  References: <E1TWWd4-0008AD-9E@wrigleys.postgresql.org> <10253.1353353527@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