Skip site navigation (1) Skip section navigation (2)

Database not restarting

From: "Stefan Berg" <svb1(at)ananzi(dot)co(dot)za>
To: pgsql-admin(at)postgresql(dot)org
Subject: Database not restarting
Date: 2003-03-26 10:00:06
Message-ID: web-67296096@mail01.infosat.net (view raw or flat)
Thread:
Lists: pgsql-admin
Hi list,

Having a problem shutting down
a database (ver 7.3.1)

I basically restart a certain database every night
because it always used to be the easy solution,
to get rid of unwanted zombie connections,
left by people who close front end aps by
switching off their computers.

The problem now is, that with one big database,
these type of runnaway processes actually keeps
the database from shutting down.

I initiate all this by killing the postmaster
(kill -15), I then get these nice logs :

2003-03-23 17:30:01 LOG:  smart shutdown request
2003-03-23 17:30:01 LOG:  shutting down
2003-03-23 17:30:02 LOG:  connection received: host=bubba
port=3400000
2003-03-23 17:30:02 FATAL:  The database system is shutting
down
2003-03-23 17:30:04 LOG:  recycled transaction log file
00000052000000A0
2003-03-23 17:30:04 LOG:  recycled transaction log file
00000052000000A1
2003-03-23 17:30:04 LOG:  recycled transaction log file
00000052000000A2
2003-03-23 17:30:04 LOG:  removing transaction log file
00000052000000A3
2003-03-23 17:30:04 LOG:  removing transaction log file
00000052000000A4
2003-03-23 17:30:04 LOG:  removing transaction log file
00000052000000A5
2003-03-23 17:30:04 LOG:  removing transaction log file
00000052000000A6
2003-03-23 17:30:04 LOG:  database system is shut down
2003-03-25 18:01:14 LOG:  database system was shut down at
2003-03-25 18:00:54 SAST

OK, the fictional host trying to connect, is a script
I wrote to check if the database has been shut down or not.
You can see my problem between 17:30:04 and 18:01:14

This was caused by some stray idle connection that I
just killed (-15), and then the database finally shut down.

My current script attempt to kill this kind of stray
process,
is making me scared. Now my question:

Can anyone give some advise on an elegant way to shut down
the database properly. In my case, I don't worry or care
if someone was still busy on the database, because nobody
updates stuff.

Any help will be appreciated.

Stef 
 
==
Download ringtones, logos and picture messages at Ananzi Mobile Fun.
http://www.ananzi.co.za/cgi-bin/goto.pl?mobile


Responses

pgsql-admin by date

Next:From: sdurandDate: 2003-03-26 12:12:29
Subject: JSP ???
Previous:From: Victor YegorovDate: 2003-03-26 09:56:06
Subject: Re: About changing type af a column

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group