Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 542bdb2

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 b0f2d68 commit 542bdb2

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
@@ -5864,6 +5864,7 @@ StartupXLOG(void)
58645864
if (record != NULL)
58655865
{
58665866
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
5867+
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
58675868
ereport(DEBUG1,
58685869
(errmsg("checkpoint record is at %X/%X",
58695870
checkPointLoc.xlogid, checkPointLoc.xrecoff)));
@@ -5888,6 +5889,7 @@ StartupXLOG(void)
58885889
ereport(FATAL,
58895890
(errmsg("could not locate required checkpoint record"),
58905891
errhint("If you are not restoring from a backup, try removing the file \"%s/backup_label\".", DataDir)));
5892+
wasShutdown = false; /* keep compiler quiet */
58915893
}
58925894
/* set flag to delete it later */
58935895
haveBackupLabel = true;
@@ -5932,10 +5934,10 @@ StartupXLOG(void)
59325934
(errmsg("could not locate a valid checkpoint record")));
59335935
}
59345936
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
5937+
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
59355938
}
59365939

59375940
LastRec = RecPtr = checkPointLoc;
5938-
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
59395941

59405942
ereport(DEBUG1,
59415943
(errmsg("redo record is at %X/%X; shutdown %s",

0 commit comments

Comments
 (0)