Re: pg_stop_backup does not complete
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: jd@commandprompt.com
Cc: Josh Berkus <josh@agliodbs.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-02-23T19:49:43Z
Lists: pgsql-hackers
On Tue, Feb 23, 2010 at 12:52 PM, Joshua D. Drake <jd@commandprompt.com> wrote: > On Tue, 2010-02-23 at 09:45 -0800, Josh Berkus wrote: >> Simon, Fujii, All: >> >> While demoing HS/SR at SCALE, I ran into a problem which is likely to be >> a commonly encountered bug when people first setup HS/SR. Here's the >> sequence: >> >> 1) Set up a brand new master with an archive-commmand and archive=on. >> >> 2) Start the master >> >> 3) Do a pg_start_backup() >> >> 4) Realize, based on log error messages, that I've misconfigured the >> archive_command. >> >> 5) Attempt to shut down the master. Master tells me that pg_stop_backup >> must be run in order to shut down. > > If I issue a shutdown, PostgreSQL should do whatever it needs to do to > shutdown; including issuing a pg_stop_backup. Maybe. But for sure, if it doesn't, and instead tells the user to issue pg_stop_backup(), then pg_stop_backup() had better WORK when the user tries to execute it. I gather that the problem is that it has to finish all that outstanding archiving before shutting down, in which case Kevin's suggestion of having a command to abort the backup seems reasonable. I might call it pg_abort_backup() rather than pg_fail_backup(), but... ...Robert