Re: pg_ctl: server does not shut down

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: gnanam(at)zoniac(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_ctl: server does not shut down
Date: 2010-10-25 15:22:46
Message-ID: 4CC5A0C6.8080901@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Gnanakumar wrote:
> 1. What could be the root cause of PostgreSQL server not shutting
> down ever?
> 2. Am I following a different/incorrect way of disabling PITR?
>

You can check if PITR is disabled by executing:

SHOW archive_command;

At a psql prompt. If that's empty, then you turned it off, and it isn't
involved in the shutdown issue you have anymore.

Normally when the server doesn't want to shut down, that's because of a
client that won't exit normally, not something in the main server. Take
a look at what processes are still running against the database and see
if there are clients attached after the fast shutdown attempt. If so,
those are your problem, not something to PITR.

If you know every client has been stopped or is doing nothing useful,
you can do an immediate shutdown of the server and kick everyone off.
You'll get messages about unclean shutdown, but no data should be lost.
The "service" scripts don't do that though. You'll need to do something
like this instead, presuming you start as root:

su postgres
pg_ctl -D /var/lib/pgsql/data -m immedate stop

--
Greg Smith, 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services and Support www.2ndQuadrant.us
Author, "PostgreSQL 9.0 High Performance" Pre-ordering at:
https://www.packtpub.com/postgresql-9-0-high-performance/book

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Nick 2010-10-25 17:01:28 Re: autovacuum launcher process eating up 17G+ of ram?
Previous Message Thomas Kellerer 2010-10-25 14:05:08 Re: Creating role using batch file in windows

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-10-25 15:26:01 Re: Extensions, this time with a patch
Previous Message Tom Lane 2010-10-25 14:30:54 Re: bug in explain - core dump