Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Date
Msg-id 1241709276.6109.230.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Thu, 2009-05-07 at 17:54 +0300, Heikki Linnakangas wrote:
> Simon Riggs wrote:
> > On Thu, 2009-05-07 at 12:15 +0300, Heikki Linnakangas wrote:
> > 
> >> Yeah, I think you're right. If you omit pg_xlog from the base backup,
> >> as we recommend in the manual, and clear the old files from the
> >> archive too, then you won't have the old history file around.
> > 
> > ...
> > A more useful thing might be to do an xlog switch before we do the
> > shutdown checkpoint at end of recovery. That gives the same sequence of
> > actions without modifying the existing sequence of activities for
> > backups, which is delicate enough for me to not want to touch it.
> 
> Hmm, yeah should work as well. I find the recovery sequence to be even 
> more delicate, though, than pg_start_backup(). I think you'd need to 
> write the XLOG switch record using the old timeline ID, as we currently 
> require that the timeline changes only at a shutdown checkpoint record. 
> That's not hard, but does make me a bit nervous.
> 
> The advantage of that over switching xlog segment in pg_start_backup() 
> would be that you would go through fewer XLOG segments if you took 
> backups often.

Yes, you're right about the delicacy of all of this so both suggestions
sound kludgey - the problem is to do with timelines not with sequencing
of checkpoints and log switches. The problem is Mikael deleted the
history file and he shouldn't have done that. We need some explicit
protection for when that occurs, I feel, to avoid it breaking again in
the future with various changes we have planned.

If the history file is so important, we shouldn't only store it in the
archive. We should keep a copy locally as well and refer to it if the
archived copy is missing.

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Next
From: Robert Haas
Date:
Subject: Re: Patch to fix search_path defencies with pg_bench