postgres.git / summary / log / commit / refs
commit f5cf3ce7a47bad3c5d7ae59d9e302ee55141439d
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Thu Nov 11 17:21:49 2010 +0000
First released in: 9.1.0, 8.1.23, 8.2.19, 8.3.13, 8.4.6, 9.0.2
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.
src/backend/access/transam/xlog.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 794c0b5422f..a8fdf407809 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -4424,6 +4424,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)));
@@ -4448,6 +4449,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 */
}
}
else
@@ -4480,10 +4482,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",
[parent: 5154ebad98ac]