8000 Fix bug introduced by the recent patch to check that the checkpoint redo · machack666/postgres@3ef6ea3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ef6ea3

Browse files
committed
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.
1 parent 1a6b439 commit 3ef6ea3

File tree

1 file changed

+3
-1
lines changed
  • src/backend/access/transam

1 file changed

+3
-1
lines changed

src/backend/access/transam/xlog.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4781,6 +4781,7 @@ StartupXLOG(void)
47814781
if (record != NULL)
47824782
{
47834783
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
4784+
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
47844785
ereport(LOG,
47854786
(errmsg("checkpoint record is at %X/%X",
47864787
checkPointLoc.xlogid, checkPointLoc.xrecoff)));
@@ -4805,6 +4806,7 @@ StartupXLOG(void)
48054806
ereport(FATAL,
48064807
(errmsg("could not locate required checkpoint record"),
48074808
errhint("If you are not restoring from a backup, try removing the file \"%s/backup_label\".", DataDir)));
4809+
wasShutdown = false; /* keep compiler quiet */
48084810
}
48094811
/* set flag to delete it later */
48104812
haveBackupLabel = true;
@@ -4839,10 +4841,10 @@ StartupXLOG(void)
48394841
(errmsg("could not locate a valid checkpoint record")));
48404842
}
48414843
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
4844+
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
48424845
}
48434846

48444847
LastRec = RecPtr = checkPointLoc;
4845-
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
48464848

48474849
ereport(LOG,
48484850
(errmsg("redo record is at %X/%X; undo record is at %X/%X; shutdown %s",

0 commit comments

Comments
 (0)
0