Re: backup_label and server start

From: "Peter Childs" <peterachilds(at)gmail(dot)com>
To:
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: backup_label and server start
Date: 2007-11-21 09:47:22
Message-ID: a2de01dd0711210147r7ba662e9l861e785129ef757e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21/11/2007, Simon Riggs <simon(at)2ndquadrant(dot)com> 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. There is always a need for a careful
> procedure to manually shutdown a live server, interlocking with other
> applications. ISTM like a manual procedure will resolve this for you.
>
> If we remove the file in the place you suggest then an Archive Recovery
> will succeed when it should fail, with no possibility of a hint, which
> seems a worse error.
>
> > All I want to do is restart a server after a clean shutdown.
> >
> > How about my second suggestion:
> >
> > Remove backup_label when the server shuts down cleanly.
> > In that case an online backup in progress will not be useful
> > anyway, and there is no need to recover on server restart.
>
> 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.
>
>
How about this, emit a warning on shutdown and fail to shutdown until the
backup has finished.

Seams to me that either way your sunk if you shut down a server while a
backup is in progress. Your only way out is to work out weather to use the
previous pitr backups plus logs or remove the label. Doing it automatically
would be very very dangerous.

Peter.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-11-21 11:41:28 Re: plperl failure on OS X 10.5(.1)
Previous Message Simon Riggs 2007-11-21 09:07:45 Re: backup_label and server start