Re: Shutting down a warm standby database in

From: Stephen Harris <lists(at)spuddy(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Shutting down a warm standby database in
Date: 2006-11-30 20:52:23
Message-ID: 20061130205223.GA363@pugwash.spuddy.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, Nov 30, 2006 at 01:32:31PM -0500, Tom Lane wrote:
> Stephen Harris <lists(at)spuddy(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-11-30 20:59:15 Re: Shutting down a warm standby database in
Previous Message Scott Marlowe 2006-11-30 20:47:47 Re: Separation of clients' data within a database

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-11-30 20:56:21 Re: Order of checking for readline support libraries
Previous Message Bruce Momjian 2006-11-30 20:45:22 Re: Order of checking for readline support