postgres.git / summary / log / commit / refs

commit    3aefff422a9b0fffa7e3a6affdbf491a20c3abaa
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Wed Jan 08 21:06:03 2014 +0000
First released in: 9.4.0, 9.1.12, 9.2.7, 9.3.3

    Fix pause_at_recovery_target + recovery_target_inclusive combination.
    
    If pause_at_recovery_target is set, recovery pauses *before* applying the
    target record, even if recovery_target_inclusive is set. If you then
    continue with pg_xlog_replay_resume(), it will apply the target record
    before ending recovery. In other words, if you log in while it's paused
    and verify that the database looks OK, ending recovery changes its state
    again, possibly destroying data that you were tring to salvage with PITR.
    
    Backpatch to 9.1, this has been broken since pause_at_recovery_target was
    added.


src/backend/access/transam/xlog.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 2ea0bb07aaf..9ae01c13d51 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -5574,11 +5574,6 @@ StartupXLOG(void) */ if (recoveryStopsHere(record, &recoveryApply)) { - if (recoveryPauseAtTarget) - { - SetRecoveryPause(true); - recoveryPausesHere(); - } reachedStopPoint = true; /* see below */ recoveryContinue = false; @@ -5709,6 +5704,12 @@ StartupXLOG(void) * end of main redo apply loop */ + if (recoveryPauseAtTarget && reachedStopPoint) + { + SetRecoveryPause(true); + recoveryPausesHere(); + } + ereport(LOG, (errmsg("redo done at %X/%X", (uint32) (ReadRecPtr >> 32), (uint32) ReadRecPtr))); [parent: 425bef6ee7f2]