On Thu, Nov 30, 2006 at 01:32:31PM -0500, Tom Lane wrote:
> Stephen Harris <lists@spuddy.org> writes:
> > I think this is more than cosmetic; shutting down a standby database
> > cleanly is critical functionality for proper warm-standby procedures.
> > What we have now "works", but should be tidied up.
>
> I've made some small adjustments that make "pg_ctl stop -m fast" work
> for shutting down a warm-standby server. Please test.
That's a lot cleaner. "fast" is good because of SIGTERM, which the
shell script also will respond to even while waiting on another process
LOG: restored log file "00000001000000000000003E" from archive
Thu Nov 30 15:45:56 EST 2006: Attempting to restore 00000001000000000000003F
Thu Nov 30 15:45:58 EST 2006: Finished 00000001000000000000003F
LOG: restored log file "00000001000000000000003F" from archive
Thu Nov 30 15:45:59 EST 2006: Attempting to restore 000000010000000000000040
Thu Nov 30 15:45:59 EST 2006: Waiting for file to become available
LOG: received fast shutdown request
Terminated
FATAL: could not restore file "000000010000000000000040" from archive: return code 36608
LOG: startup process (PID 10730) exited with exit code 1
LOG: aborting startup due to startup process failure
LOG: logger shutting down
(the datestamp entries are from my script)
Starting up the standby database still goes back to earlier log files,
but I guess that's the 100 checkpoint thing you mentioned earlier.
The change you just made is very good and very much tidier; no core files,
no panics, cleans up children nicely. Good stuff!
--
rgds
Stephen