Re: pg_ctl: server does not shut down

From: "Gnanakumar" <gnanam(at)zoniac(dot)com>
To: "'Greg Smith'" <greg(at)2ndquadrant(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_ctl: server does not shut down
Date: 2010-10-28 07:57:02
Message-ID: 004f01cb7675$b7118120$25348360$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

>> 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.

> Yes, I could see empty value here.

>> 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.

> Yes, I can see the following processes still running. I used the command
'ps
> -ef |grep postgres' to list.
> postgres 3376 1 0 07:20 ? 00:00:00
> /mnt/database/pgsql/bin/postgres -D /usr/local/pgsql/data
> postgres 3381 3376 0 07:20 ? 00:00:00 postgres: logger process
> postgres 3383 3376 0 07:20 ? 00:00:00 postgres: writer process

> But why logger and writer process are still running/showing up here for a
> very long time after issuing 'service postgresql stop'. What could be the
> problem? Also, am sure here that no other clients (database connections)
> are connected at this time.

I can CONSISTENTLY reproduce this problem (PITR walarchive drive is not
attached/mounted) and I still don't know the reason behind this issue:
1) If I disable PITR and start postgresql service, consistently server does
not shut down on 'service postgresql stop' command. I have tried and
checked this upto 4 times.
NOTE: After disabling PITR, on checking "SHOW archive_command" from psql,
it is showing empty value. But on 'ps -ef |grep postgres', it is always
showing up
logger and writer process running.

2) But if I enable back PITR and start postgresql service, consistently
server shuts down properly on 'service postgresql stop' command. Again I
have tried this cycle also upto 4 times.

When I mean enable/disable PITR, it is about enabling/disabling 2
configuration parameters: "archive_command" and "archive_timeout".

Since this is our Production server, experts assistance to solve this issue
are highly appreciated.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Little, Douglas 2010-10-28 12:39:19 Forced quiesce
Previous Message Isabella Ghiurea 2010-10-27 19:48:39 PG 9.0 streaming replication cfg question

Browse pgsql-hackers by date

  From Date Subject
Next Message Boszormenyi Zoltan 2010-10-28 09:33:22 Re: plan time of MASSIVE partitioning ...
Previous Message Josh Berkus 2010-10-28 05:13:26 Re: Simplifying replication