Re: standby shutdown - Mailing list pgsql-admin

From Ray Stell
Subject Re: standby shutdown
Date
Msg-id 20090504130648.GC16883@cns.vt.edu
Whole thread Raw
In response to Re: standby shutdown  (Robert Treat <xzilla@users.sourceforge.net>)
Responses Re: standby shutdown  (Ray Stell <stellr@cns.vt.edu>)
List pgsql-admin
On Sat, May 02, 2009 at 12:13:42AM -0400, Robert Treat wrote:
>
> First tip, dont use -i, it isn't needed. I'd try withought any flag and work
> up if needed. Be patient unless you can't afford to be.



thanks, Robert, I assume you mean don't use -m i, I don't see a -i anywhere.

So, you are saying just shutdown, but it is my experience that this might not
work and I need to script this for the operator to do the maintenance.

Here I get:

$ pg_ctl stop -D /data/pgsql/alerts_oamp/
waiting for server to shut down............................................................... failed
pg_ctl: server does not shut down

and ps says the postmaster is still up:

ps -ef | grep 502
502      12914     1  0 08:20 pts/0    00:00:00 /usr/local/pgsql836/bin/postgres -D /data/pgsql/alerts_oamp
502      12915 12914  0 08:20 ?        00:00:00 postgres: logger process
502      12916 12914  0 08:20 ?        00:00:01 postgres: startup process   waiting for 00000001000000000000000E
502      13064 12916  0 08:29 ?        00:00:00 sh -c /usr/local/pgsql/bin/pg_standby  /data/pgsql/wals/alerts_oamp
00000001000000000000000Epg_xlog/RECOVERYXLOG 00000001000000000000000C >> /home/postgresql/log/alerts_oamp/recovery.log 
502      13065 13064  0 08:29 ?        00:00:00 /usr/local/pgsql/bin/pg_standby /data/pgsql/wals/alerts_oamp
00000001000000000000000Epg_xlog/RECOVERYXLOG 00000001000000000000000C 


seems like I need more that patience here, but I don't know what?  The log doesn't help much:

2009-05-04 08:20:53 EDT,0, LOG:  restored log file "00000001000000000000000C" from archive
2009-05-04 08:20:53 EDT,0, LOG:  restored log file "00000001000000000000000D" from archive
2009-05-04 08:20:52 EDT,0, LOG:  received smart shutdown request

should I loop in the shutdown script on "pg_ctl stop" until the postmaster pid goes away?



> This indicates it couldn't find the files it was looking for rather than
> something being necessarily broken. This makes me wonder about your xlog
> retention policy; it sounds like you might be deleting xlogs more agressivly
> than you should be. I'd suggest you look into the %r option for pg_standby.
> HTH.


I'll be the first to admit I don't really know the details of this.
I'm just taking the default, %r.  If the default is too "agressive"
to allow recovery, then why is it that the default?  Shouldn't some
behavior that allows for recovery be the default?

pgsql-admin by date:

Previous
From: Robert Treat
Date:
Subject: Re: standby shutdown
Next
From: Ray Stell
Date:
Subject: Re: standby shutdown