diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-11-11 19:21:49 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-11-11 19:32:03 +0200 |
commit | d434e8f6ad2580a9137cc91d27af54e73079a471 (patch) | |
tree | 1d570c6686c6cf1c5ae4b2608ed5f0ee272be5cc | |
parent | 5abb72f9af64339ed97eb991b0bd3456bd651f8e (diff) | |
download | postgresql-d434e8f6ad2580a9137cc91d27af54e73079a471.tar.gz postgresql-d434e8f6ad2580a9137cc91d27af54e73079a471.zip |
Fix bug introduced by the recent patch to check that the checkpoint redo
location read from backup label file can be found: wasShutdown was set
incorrectly when a backup label file was found.
Jeff Davis, with a little tweaking by me.
-rw-r--r-- | src/backend/access/transam/xlog.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 698434cc5e8..712883dfa33 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -5324,6 +5324,7 @@ StartupXLOG(void) if (record != NULL) { memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint)); + wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN); ereport(DEBUG1, (errmsg("checkpoint record is at %X/%X", checkPointLoc.xlogid, checkPointLoc.xrecoff))); @@ -5348,6 +5349,7 @@ StartupXLOG(void) ereport(FATAL, (errmsg("could not locate required checkpoint record"), errhint("If you are not restoring from a backup, try removing the file \"%s/backup_label\".", DataDir))); + wasShutdown = false; /* keep compiler quiet */ } /* set flag to delete it later */ haveBackupLabel = true; @@ -5382,10 +5384,10 @@ StartupXLOG(void) (errmsg("could not locate a valid checkpoint record"))); } memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint)); + wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN); } LastRec = RecPtr = checkPointLoc; - wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN); ereport(DEBUG1, (errmsg("redo record is at %X/%X; shutdown %s", |