Re: [ADMIN] Windows Services and Postgresql 9.1.3

From: "Anibal David Acosta" <aa(at)devshock(dot)com>
To: "'Craig Ringer'" <ringerc(at)ringerc(dot)id(dot)au>, "'Vincent Dautremont'" <vincent(at)searidgetech(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: [ADMIN] Windows Services and Postgresql 9.1.3
Date: 2012-09-21 15:06:44
Message-ID: 007c01cd980a$b8c2c700$2a485500$@devshock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Yes, (I think) is a Bug, sometimes in some circumstances pg_ctl go down but
postgres server still running.

You can easily reproduce.

Go to "task manager", kill the process "pg_ctl" (simulate some kind of crash
or something else).
Now go to services management and try to start again. Start command will
through an error because pg_ctl can't start database because is already
started.

Due to this bug I always use the pg_ctl command directly and not the windows
service.

Running pg_ctl command from command prompt show that postgres server is
running, but windows service show stopped and is not possible to start again
from windows service UI

The windows service also can remain in an inconsistent state when the pg_ctl
can't stop the postgres server.
I think that pg_ctl uses stop "fast" so, if for some reason postgres don't
response to stop fast, the service in windows service UI appear as stopping
for long time and finally after some kind of timeout it show as not started.

Obviously, if it appear as not started you want to start, but you can't. And
maybe some inexperienced user get crazy, "database is stopped and can't
start" but really DB is started.

What the inexperienced do is the only thing he can do... Restart the server,
when he restart the postgres server receive a KILL message and then
everything get worse

I live this situation time ago and obviously learn :)
Regards

-----Mensaje original-----
De: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] En nombre de Craig Ringer Enviado
el: lunes, 17 de septiembre de 2012 12:43 a.m.
Para: Vincent Dautremont
CC: pgsql-admin(at)postgresql(dot)org
Asunto: Re: [ADMIN] Windows Services and Postgresql 9.1.3

On 09/12/2012 04:48 AM, Vincent Dautremont wrote:

> For example, after the server had rebooted, I would stop the service
> from services.msc Windows then reports it as stopped but I can still
> see that the database is running, and can use it.

Check in the process monitor (or, better, with Process Explorer from
Sysinternals) to see what user the `postgres.exe` processes are running as.

> When I would start the service again, I would end up with a timeout
> waiting for the service to be started. When in fact the database was
> always running.
>
> Anyone had that bug/problem before ?

Nope. Sounds completely crazy. More info needed, though.

--
Craig Ringer

--
Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Craig James 2012-09-21 15:21:04 Re: how to allow integer overflow for calculating hash code of a string?
Previous Message Rural Hunter 2012-09-21 09:16:46 Re: [ADMIN] pg_upgrade from 9.1.3 to 9.2 failed

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2012-09-21 15:27:39 Re: Expression to construct a anonymous record with named columns?
Previous Message Tom Lane 2012-09-21 14:57:53 Re: pg_upgrade: out of memory