Re: [HACKERS] backup_label and server start

2008-03-17 Thread Bruce Momjian
Added to TODO: o Fix server restart problem when the server was shutdown during a PITR backup http://archives.postgresql.org/pgsql-hackers/2007-11/msg00800.php --- Albe Laurenz wrote: If the

Re: [HACKERS] backup_label and server start

2007-11-24 Thread Bruce Momjian
This has been saved for the 8.4 release: http://momjian.postgresql.org/cgi-bin/pgpatches_hold --- Albe Laurenz wrote: If the postmaster is stopped with 'pg_ctl stop' while an online backup is in progress, the

Re: [HACKERS] backup_label and server start

2007-11-21 Thread Albe Laurenz
If the postmaster is stopped with 'pg_ctl stop' while an online backup is in progress, the 'backup_label' file will remain in the data directory. [...] the startup process will fail with a message like this: [...] PANIC: could not locate required checkpoint record HINT: If you are not

Re: [HACKERS] backup_label and server start

2007-11-21 Thread Simon Riggs
On Wed, 2007-11-21 at 09:04 +0100, Albe Laurenz wrote: If somebody stops the postmaster while an online backup is in progress, there is no warning or nothing. Only the server will fail to restart. Well, it seems best not to do this. There is always a need for a careful procedure to manually

Re: [HACKERS] backup_label and server start

2007-11-21 Thread Peter Childs
On 21/11/2007, Simon Riggs [EMAIL PROTECTED] wrote: On Wed, 2007-11-21 at 09:04 +0100, Albe Laurenz wrote: If somebody stops the postmaster while an online backup is in progress, there is no warning or nothing. Only the server will fail to restart. Well, it seems best not to do this.

Re: [HACKERS] backup_label and server start

2007-11-21 Thread Simon Riggs
On Wed, 2007-11-21 at 09:47 +, Peter Childs wrote: How about this, emit a warning on shutdown and fail to shutdown until the backup has finished. That would be reasonable for -m smart shutdown. We would then be treating the backup as a connection. ...but not for a fast shutdown. Any

Re: [HACKERS] backup_label and server start

2007-11-21 Thread Albe Laurenz
Simon Riggs wrote: If somebody stops the postmaster while an online backup is in progress, there is no warning or nothing. Only the server will fail to restart. Well, it seems best not to do this. There is always a need for a careful procedure to manually shutdown a live server,

Re: [HACKERS] backup_label and server start

2007-11-21 Thread Simon Riggs
On Wed, 2007-11-21 at 15:04 +0100, Albe Laurenz wrote: Simon Riggs wrote: If somebody stops the postmaster while an online backup is in progress, there is no warning or nothing. Only the server will fail to restart. Well, it seems best not to do this. There is always a need for a

Re: [HACKERS] backup_label and server start

2007-11-21 Thread Albe Laurenz
Simon Riggs wrote: That will make PITRs fail: 1. pg_start_backup() 2. backup 3. shutdown, removes backup_label 4. pg_stop_backup() step 4 will now fail because of a missing backup_label file. Wait a minute: pg_stop_backup() will also fail in the current setup, because after recovery

Re: [HACKERS] backup_label and server start

2007-11-21 Thread Albe Laurenz
Simon Riggs wrote: On Wed, 2007-11-21 at 09:47 +, Peter Childs wrote: How about this, emit a warning on shutdown and fail to shutdown until the backup has finished. That would be reasonable for -m smart shutdown. We would then be treating the backup as a connection. ...but not for

[HACKERS] backup_label and server start

2007-11-20 Thread Albe Laurenz
If the postmaster is stopped with 'pg_ctl stop' while an online backup is in progress, the 'backup_label' file will remain in the data directory. There is no recovery.conf file present. When the server is started again, it attempts to recover from the checkpoint marked in the backup_label file

Re: [HACKERS] backup_label and server start

2007-11-20 Thread Tom Lane
Albe Laurenz [EMAIL PROTECTED] writes: wouldn't it be a good thing for the startup process to ignore (and rename) the backup_label file if no recovery.conf is present? No, it certainly wouldn't. I don't see why we should simplify the bizarre case you're talking about at the price of putting

Re: [HACKERS] backup_label and server start

2007-11-20 Thread Simon Riggs
On Tue, 2007-11-20 at 15:19 +0100, Albe Laurenz wrote: We will fail to restore a consistent database state sounds rather intimidating. Well, how else should a warning of data loss sound? :-) It's vaguely possible that the database state could be consistent, if the server were quiet when you