Re: PG service restart failure (start getting ahead of stop?) - Mailing list pgsql-general

From George Pavlov
Subject Re: PG service restart failure (start getting ahead of stop?)
Date
Msg-id 8C5B026B51B6854CBE88121DBF097A86B1EE35@ehost010-33.exch010.intermedia.net
Whole thread Raw
In response to Re: PG service restart failure (start getting ahead of stop?)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PG service restart failure (start getting ahead of stop?)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> > So it looks like the STOPPING of the service actually
> > succeeded, albeit
> > it took a while (more than the usual sessions open?). The
> > STARTING is
> > the one that actually failed (is that because the STOP was still in
> > process?).  The question is why -- in a RESTART situation
> > wouldn't/shouldn't the START part wait for the STOP part to complete
> > (regardless of how long it takes)?
>
> Well, this'd depend on the details of the postgres init script you're
> using, which you gave no hint about (and yes, there are a *ton* of
> different versions out there).  The one I'm currently shipping for Red
> Hat would give up waiting after a minute, but it should report failure
> not success in that case.

oh, sorry, i did not realize there were many of them. this is the 8.1.8
redhat one; the (hopefully) identifying lines are:

 64 # Version 8.1 Devrim Gunduz <devrim@PostgreSQL.org>
 65 # Increased sleep time from 1 sec to 2 sec.
 66
 67 # PGVERSION is the full package version, e.g., 8.1.1
 68 # Note: the specfile ordinarily updates this during install
 69 PGVERSION=8.1.8

i have examined the stop() and start() and i think i understand why the
stop() reported a failure (it took to long), but i don't understand how
the start() could have reported success:

>   Stopping postgresql service: [FAILED]
>   Starting postgresql service: [  OK  ]

there was definitely no running DB after that (until someone manually
started it hours later).

> > We have a nightly restart of one PG database.
>
> Just out of curiosity, what for?  I can't imagine any really
> good reason
> for just shutting down the postmaster and immediately restarting it.

why have a "restart" option if there is never a reason for it? :-)
seriously, this is a good question, i think this was someone's idea of a
quick way to clear any remaining DB sessions in order to be able to drop
a database and restore a newer version (this is a reporting DB that gets
refreshed nightly with a dump from another DB). this seems a bit
misguided in that if you want to kill sessions you should just kill
sessions, (a la http://varlena.com/GeneralBits/29.html), right? what's
your opinion on the best way to do this?

thanks.

george

pgsql-general by date:

Previous
From: "Marcelo de Moraes Serpa"
Date:
Subject: Re: Audit-trail engine: getting the application's layer user_id
Next
From: "Andy Dale"
Date:
Subject: Re: Generic triggers ?