Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B05A0633897 for ; Wed, 12 May 2010 11:25:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 06991-03-7 for ; Wed, 12 May 2010 14:25:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f223.google.com (mail-ew0-f223.google.com [209.85.219.223]) by mail.postgresql.org (Postfix) with ESMTP id 547EE635503 for ; Wed, 12 May 2010 11:22:17 -0300 (ADT) Received: by ewy23 with SMTP id 23so40193ewy.34 for ; Wed, 12 May 2010 07:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=dSXvAq39cwntg+xdoLnP74Z0CmL6dbVQeSRSNyl/igE=; b=eBKkbIEt5KymSUjMeXAKISBdJ9ARw0WfMVyyc9aGemm89mu3U2M6JhOUSphddi9DE0 BoLOr3ivLEkIizdWcwL3Hj6NOngH8qGb0l0YtYlfFwFR6bxtrVrKHTjLFjvCoAEq/wHH xNxkcF0SUtf5duL3UrGwE4Y1GLKr05jmKtCAo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UiJmKjqQRpncYy7r+LGLwUk51kkDvynPUWHAz5782Cx5env49xQeb31njwVJE+FiVy tMtVCdG9JUoXWfe87E+lQeZki4ef81ruuIsQ0EVko/1ZoDHJ7XByglRCtAYS0qxLg0Sh 6v7X4KmZUYdatQhsybzgFsvm6Iriv43cNWJGk= MIME-Version: 1.0 Received: by 10.102.254.24 with SMTP id b24mr4639714mui.5.1273674135052; Wed, 12 May 2010 07:22:15 -0700 (PDT) Received: by 10.103.138.19 with HTTP; Wed, 12 May 2010 07:22:14 -0700 (PDT) Date: Wed, 12 May 2010 10:22:14 -0400 Message-ID: Subject: Shutdown fails with both 'fast' and 'immediate' From: David Schnur To: pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=0016364267236134d60486665e22 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201005/128 X-Sequence-Number: 34601 --0016364267236134d60486665e22 Content-Type: text/plain; charset=ISO-8859-1 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 --0016364267236134d60486665e22 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I develop an app that uses a back-end Postgres database, currently 8.3.9. = =A0The database is started when the app starts up, and stopped when it shut= s down. =A0Shutdown uses pg_ctl with -m fast, and waits two minutes for the= process to complete. =A0If it doesn't, it tries -m immediate, and wait= s two more minutes before logging an error and giving up.

One user, on OSX 10.5.8, has a script that stops the app eac= h morning, to upgrade to the newest build. =A0In his case, both the fast an= d immediate shutdowns time out, and Postgres continues running for at least= 2-4 hours. =A0At 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 y= et. =A0It 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 run= s as part of the application's daily maintenance. =A0The size of the DE= LETE varies, and in his case happened to be unusually large one day, which = is apparently what triggered the problem. =A0Since the DELETE never gets a = chance to finish, the problem recurs every morning.

I'll obviously need to deal with that query, but I&= #39;m concerned that Postgres is unable to interrupt it. =A0Why might this = be happening? =A0Thanks,

David
--0016364267236134d60486665e22--