Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Fujii Masao
On Wed, Apr 28, 2010 at 4:12 AM, Heikki Linnakangas wrote: > Simon Riggs wrote: >> On Tue, 2010-04-27 at 20:14 +0300, Heikki Linnakangas wrote: >>> Simon Riggs wrote: On Tue, 2010-04-27 at 18:13 +0300, Heikki Linnakangas wrote: > Simon Riggs wrote: >> If pg_stop_backup() is run it cre

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Heikki Linnakangas
Simon Riggs wrote: > On Tue, 2010-04-27 at 20:14 +0300, Heikki Linnakangas wrote: >> Simon Riggs wrote: >>> On Tue, 2010-04-27 at 18:13 +0300, Heikki Linnakangas wrote: Simon Riggs wrote: > If pg_stop_backup() is run it creates the .backup file in the archive. > In the absence of that

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Simon Riggs
On Tue, 2010-04-27 at 20:14 +0300, Heikki Linnakangas wrote: > Simon Riggs wrote: > > On Tue, 2010-04-27 at 18:13 +0300, Heikki Linnakangas wrote: > >> Simon Riggs wrote: > >>> If pg_stop_backup() is run it creates the .backup file in the archive. > >>> In the absence of that file, we should be abl

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Heikki Linnakangas
Simon Riggs wrote: > On Tue, 2010-04-27 at 18:13 +0300, Heikki Linnakangas wrote: >> Simon Riggs wrote: >>> If pg_stop_backup() is run it creates the .backup file in the archive. >>> In the absence of that file, we should be able to work out that >>> pg_stop_backup() was not run. >> It's just as l

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Simon Riggs
On Tue, 2010-04-27 at 18:13 +0300, Heikki Linnakangas wrote: > Simon Riggs wrote: > > If pg_stop_backup() is run it creates the .backup file in the archive. > > In the absence of that file, we should be able to work out that > > pg_stop_backup() was not run. > > It's just as likely that the file

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Tom Lane
Heikki Linnakangas writes: > Tom Lane wrote: >> Isn't the above statement complete nonsense? There's nothing to stop >> the DBA from issuing pg_stop_backup() after he restarts the master. > pg_stop_backup() can't be called if there's no backup in progress. > Restart cancels it. Doh, right (not

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Heikki Linnakangas
Simon Riggs wrote: > If pg_stop_backup() is run it creates the .backup file in the archive. > In the absence of that file, we should be able to work out that > pg_stop_backup() was not run. It's just as likely that the file is there even though the backup didn't finish, though. -- Heikki Linn

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Heikki Linnakangas
Robert Haas wrote: > On Tue, Apr 27, 2010 at 5:25 AM, Heikki Linnakangas > wrote: >> Yep. I've committed a patch to do that. > > Is there no way for the slave to recover from this situation? No, it will never open up for hot standby, and it will error at the end of recovery anyway. This just mak

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Heikki Linnakangas
Tom Lane wrote: > Heikki Linnakangas writes: >> Hmm, we could throw an error in the standby, when we see a shutdown >> checkpoint while we're waiting for an end-backup record. If the database >> was shut down before pg_stop_backup(), we know that the backup was >> cancelled and the end-backup reco

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Tom Lane
Heikki Linnakangas writes: > Hmm, we could throw an error in the standby, when we see a shutdown > checkpoint while we're waiting for an end-backup record. If the database > was shut down before pg_stop_backup(), we know that the backup was > cancelled and the end-backup record we're waiting for w

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Simon Riggs
On Tue, 2010-04-27 at 12:25 +0300, Heikki Linnakangas wrote: > Fujii Masao wrote: > > On Tue, Apr 27, 2010 at 4:19 PM, Heikki Linnakangas > > wrote: > >> Hmm, we could throw an error in the standby, when we see a shutdown > >> checkpoint while we're waiting for an end-backup record. If the databas

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Fujii Masao
On Tue, Apr 27, 2010 at 8:07 PM, Robert Haas wrote: > On Tue, Apr 27, 2010 at 5:25 AM, Heikki Linnakangas > wrote: >> Yep. I've committed a patch to do that. > > Is there no way for the slave to recover from this situation? Probably Yes. You would need to take a fresh base backup and restart the

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Robert Haas
On Tue, Apr 27, 2010 at 5:25 AM, Heikki Linnakangas wrote: > Yep. I've committed a patch to do that. Is there no way for the slave to recover from this situation? ...Robert -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.po

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Heikki Linnakangas
Fujii Masao wrote: > On Tue, Apr 27, 2010 at 4:19 PM, Heikki Linnakangas > wrote: >> Hmm, we could throw an error in the standby, when we see a shutdown >> checkpoint while we're waiting for an end-backup record. If the database >> was shut down before pg_stop_backup(), we know that the backup was

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Fujii Masao
On Tue, Apr 27, 2010 at 4:19 PM, Heikki Linnakangas wrote: > Hmm, we could throw an error in the standby, when we see a shutdown > checkpoint while we're waiting for an end-backup record. If the database > was shut down before pg_stop_backup(), we know that the backup was > cancelled and the end-b

Re: [HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-27 Thread Heikki Linnakangas
Josh Berkus wrote: > Here's a way to trap yourself: > > (1) Set up an HS/SR master > (2) pg_start_backup on the master > (3) clone the master to 1 or more slaves > (4) Fast shutdown the master (without pg_stop_backup) > (5) Restart the master > (6) Bring up the slaves > > Result: the slaves will

[HACKERS] Wierd quirk of HS/SR, probably not fixable

2010-04-04 Thread Josh Berkus
Hackers, Here's a way to trap yourself: (1) Set up an HS/SR master (2) pg_start_backup on the master (3) clone the master to 1 or more slaves (4) Fast shutdown the master (without pg_stop_backup) (5) Restart the master (6) Bring up the slaves Result: the slaves will come up fine in recovery mode