Skip to content

Commit f5cf3ce

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 5154eba commit f5cf3ce

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
@@ -4424,6 +4424,7 @@ StartupXLOG(void)
44244424
if (record != NULL)
44254425
{
44264426
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
4427+
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
44274428
ereport(LOG,
44284429
(errmsg("checkpoint record is at %X/%X",
44294430
checkPointLoc.xlogid, checkPointLoc.xrecoff)));
@@ -4448,6 +4449,7 @@ StartupXLOG(void)
44484449
ereport(FATAL,
44494450
(errmsg("could not locate required checkpoint record"),
44504451
errhint("If you are not restoring from a backup, try removing the file \"%s/backup_label\".", DataDir)));
4452+
wasShutdown = false; /* keep compiler quiet */
44514453
}
44524454
}
44534455
else
@@ -4480,10 +4482,10 @@ StartupXLOG(void)
44804482
(errmsg("could not locate a valid checkpoint record")));
44814483
}
44824484
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
4485+
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
44834486
}
44844487

44854488
LastRec = RecPtr = checkPointLoc;
4486-
wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
44874489

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy