Re: Issues Outstanding for Point In Time Recovery (PITR) - Mailing list pgsql-hackers

From Patrick Macdonald
Subject Re: Issues Outstanding for Point In Time Recovery (PITR)
Date
Msg-id 3D298F46.76168E58@redhat.com
Whole thread Raw
In response to Re: Issues Outstanding for Point In Time Recovery (PITR)  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
List pgsql-hackers
Zeugswetter Andreas SB SD wrote:
> 
> > As noted, one of the main problems is knowing where to begin
> > in the log.  This can be handled by having backup processing
> > update the control file with the first lsn and log file
> > required.  At the time of the backup, this information is or
> > can be made available.  The control file can be the last file
> > added to the tar and can contain information spanning the entire
> > backup process.
> 
> lsn and logfile number (of latest checkpoints) is already in the control
> file, thus you need control file at start of backup. (To reduce the number
> of logs needed for restore of an online backup you could force a checkpoint
> before starting file backup)

Maybe I should have been more clear.  The control file snapshot must 
be taken at backup start (as you mention) but can be stored in cache.
The fields can then be modified as we see fit.  At the end of backup,
we can write this to a temp file and add it to the tar.  Therefore,
as mentioned, the snapshot spans the entire backup process.
> You will also need lsn and logfile number after file backup, to know how much
> log needs to at least be replayed to regain a consistent state.

This is a nicety but not a necessity. If you have a backup end log 
record, you just have to enforce that the PIT recovery encounters 
that particular log record on forward recovery.  Once encountered,
you know that you at passed the point of back up end.

Cheers,
Patrick




pgsql-hackers by date:

Previous
From: "Sander Steffann"
Date:
Subject: Re: Should next release by 8.0 (Was: Re: [GENERAL] I am
Next
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: (A) native Windows port