mirror of
https://github.com/postgres/postgres.git
synced 2025-04-29 13:56:47 +03:00
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.
This commit is contained in:
parent
90e8efa338
commit
ad37f7af4a
@ -4931,6 +4931,7 @@ StartupXLOG(void)
|
|||||||
if (record != NULL)
|
if (record != NULL)
|
||||||
{
|
{
|
||||||
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
|
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
|
||||||
|
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
|
||||||
ereport(DEBUG1,
|
ereport(DEBUG1,
|
||||||
(errmsg("checkpoint record is at %X/%X",
|
(errmsg("checkpoint record is at %X/%X",
|
||||||
checkPointLoc.xlogid, checkPointLoc.xrecoff)));
|
checkPointLoc.xlogid, checkPointLoc.xrecoff)));
|
||||||
@ -4955,6 +4956,7 @@ StartupXLOG(void)
|
|||||||
ereport(FATAL,
|
ereport(FATAL,
|
||||||
(errmsg("could not locate required checkpoint record"),
|
(errmsg("could not locate required checkpoint record"),
|
||||||
errhint("If you are not restoring from a backup, try removing the file \"%s/backup_label\".", DataDir)));
|
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 */
|
/* set flag to delete it later */
|
||||||
haveBackupLabel = true;
|
haveBackupLabel = true;
|
||||||
@ -4989,10 +4991,10 @@ StartupXLOG(void)
|
|||||||
(errmsg("could not locate a valid checkpoint record")));
|
(errmsg("could not locate a valid checkpoint record")));
|
||||||
}
|
}
|
||||||
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
|
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
|
||||||
|
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
LastRec = RecPtr = checkPointLoc;
|
LastRec = RecPtr = checkPointLoc;
|
||||||
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
|
|
||||||
|
|
||||||
ereport(DEBUG1,
|
ereport(DEBUG1,
|
||||||
(errmsg("redo record is at %X/%X; shutdown %s",
|
(errmsg("redo record is at %X/%X; shutdown %s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user