Re: PG service restart failure (start getting ahead of stop?)

From: "George Pavlov" <gpavlov(at)mynewplace(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PG service restart failure (start getting ahead of stop?)
Date: 2007-04-24 17:29:19
Message-ID: 8C5B026B51B6854CBE88121DBF097A86B1EE35@ehost010-33.exch010.intermedia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)PostgreSQL(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dan Shea 2007-04-24 17:31:19 Re: View is not using a table index
Previous Message Marcelo de Moraes Serpa 2007-04-24 17:00:34 Re: Audit-trail engine: getting the application's layer user_id