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

Skip to content

Commit 6c4f666

Browse files
committed
Fix thinko in previous commit.
We must still initialize minRecoveryPoint if we start straight with archive recovery, e.g when recovering from a normal base backup taken with pg_start/stop_backup. Otherwise we never consider the system consistent.
1 parent 6d06049 commit 6c4f666

File tree

1 file changed

+9
-0
lines changed
  • src/backend/access/transam

1 file changed

+9
-0
lines changed

src/backend/access/transam/xlog.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5265,6 +5265,15 @@ StartupXLOG(void)
52655265
ControlFile->prevCheckPoint = ControlFile->checkPoint;
52665266
ControlFile->checkPoint = checkPointLoc;
52675267
ControlFile->checkPointCopy = checkPoint;
5268+
if (InArchiveRecovery)
5269+
{
5270+
/* initialize minRecoveryPoint if not set yet */
5271+
if (ControlFile->minRecoveryPoint < checkPoint.redo)
5272+
{
5273+
ControlFile->minRecoveryPoint = checkPoint.redo;
5274+
ControlFile->minRecoveryPointTLI = checkPoint.ThisTimeLineID;
5275+
}
5276+
}
52685277

52695278
/*
52705279
* Set backupStartPoint if we're starting recovery from a base backup.

0 commit comments

Comments
 (0)