diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2013-02-07 16:33:05 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2013-02-07 16:33:05 +0000 |
commit | 072521b8c804cc15800e503244661d17c6202ccc (patch) | |
tree | 772d53540082595a5506c488554dcdd19445b262 /src/backend/access/transam/xlog.c | |
parent | e1c1e2173248f39c1b15fca7b2a31ad7b5199ce7 (diff) | |
download | postgresql-072521b8c804cc15800e503244661d17c6202ccc.tar.gz postgresql-072521b8c804cc15800e503244661d17c6202ccc.zip |
Rely only on checkpoint 1 at end of recovery.
Searching for checkpoint 2 (previous) is not
correct in all cases.
Bug report from Heikki Linnakangas
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index d644e3982ce..f0df2977a12 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -5777,7 +5777,13 @@ StartupXLOG(void) if (fast_promote) { checkPointLoc = ControlFile->prevCheckPoint; - record = ReadCheckpointRecord(xlogreader, checkPointLoc, 2, false); + + /* + * Confirm the last checkpoint is available for us to recover + * from if we fail. Note that we don't check for the secondary + * checkpoint since that isn't available in most base backups. + */ + record = ReadCheckpointRecord(xlogreader, checkPointLoc, 1, false); if (record != NULL) { checkpoint_wait = false; |