Re: Point in Time Recovery - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Point in Time Recovery
Date
Msg-id 18739.1089753596@sss.pgh.pa.us
Whole thread Raw
In response to Re: Point in Time Recovery  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Point in Time Recovery
List pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> I'm getting carried away with the improbable....but this is the rather
> strange, but possible scenario I foresee:

> A sequence of times...
> 1. We start archiving xlogs
> 2. We take a checkpoint
> 3. we commit an important transaction
> 4. We take a backup
> 5. We take a checkpoint

> When we specify a recovery target, it is possible to specify the
> rollforward to complete just before point 3.

No, it isn't possible.  The recovery *must* proceed at least as far as
wherever the end of the log was at the time the backup was completed.
Otherwise everything is broken, not only clog, because you may have disk
blocks in your backup that postdate where you stopped log replay.

To have a consistent recovery at all, you must replay the log starting
from a checkpoint before the backup began and extending to the time that
the backup finished.  You only get to decide where to stop after that
point.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Release planning (was: Re: Status report)
Next
From: "Magnus Hagander"
Date:
Subject: Re: Is "trust" really a good default?