aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-11-11 19:21:49 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-11-11 19:31:55 +0200
commit3ef6ea3dcefebb515207d1009d81ce1d80cb1b29 (patch)
tree4a5089ad00efe852835ee0557e65cd62c8b6e9a3
parent1a6b4396013bc369a59df9ab3a637fe31f6d9ff5 (diff)
downloadpostgresql-3ef6ea3dcefebb515207d1009d81ce1d80cb1b29.tar.gz
postgresql-3ef6ea3dcefebb515207d1009d81ce1d80cb1b29.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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 3cd53fd5fa4..024093c51fe 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -4781,6 +4781,7 @@ StartupXLOG(void)
if (record != NULL)
{
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
+ wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
ereport(LOG,
(errmsg("checkpoint record is at %X/%X",
checkPointLoc.xlogid, checkPointLoc.xrecoff)));
@@ -4805,6 +4806,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;
@@ -4839,10 +4841,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(LOG,
(errmsg("redo record is at %X/%X; undo record is at %X/%X; shutdown %s",