pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Schnur <dnschnur@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Shutdown fails with both 'fast' and 'immediate'
Date: Wed, 12 May 2010 10:22:14 -0400
Message-ID: <AANLkTindCeLyRmRbgV4ICxEBGRLwyBbm5yO2oLBHUnSc@mail.gmail.com> (raw)

I develop an app that uses a back-end Postgres database, currently 8.3.9.
 The database is started when the app starts up, and stopped when it shuts
down.  Shutdown uses pg_ctl with -m fast, and waits two minutes for the
process to complete.  If it doesn't, it tries -m immediate, and waits two
more minutes before logging an error and giving up.

One user, on OSX 10.5.8, has a script that stops the app each morning, to
upgrade to the newest build.  In his case, both the fast and immediate
shutdowns time out, and Postgres continues running for at least 2-4 hours.
 At that point he brings up the terminal to kill all the back-ends manually,
so we haven't seen it finish shutting down on its own yet.  It is in fact
shutting down, because all queries fail with the 'database system is
shutting down' error.

The query running during this time is a DELETE that runs as part of the
application's daily maintenance.  The size of the DELETE varies, and in his
case happened to be unusually large one day, which is apparently what
triggered the problem.  Since the DELETE never gets a chance to finish, the
problem recurs every morning.

I'll obviously need to deal with that query, but I'm concerned that Postgres
is unable to interrupt it.  Why might this be happening?  Thanks,

David

view thread (7+ messages)  latest in thread

Message-ID: <AANLkTindCeLyRmRbgV4ICxEBGRLwyBbm5yO2oLBHUnSc@mail.gmail.com>
Permalink:  ../AANLkTindCeLyRmRbgV4ICxEBGRLwyBbm5yO2oLBHUnSc@mail.gmail.com/
Also on:    postgresql.org/message-id/AANLkTindCeLyRmRbgV4ICxEBGRLwyBbm5yO2oLBHUnSc@mail.gmail.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: dnschnur@gmail.com
  Subject: Re: Shutdown fails with both 'fast' and 'immediate'
  In-Reply-To: <AANLkTindCeLyRmRbgV4ICxEBGRLwyBbm5yO2oLBHUnSc@mail.gmail.com>

* 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