aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam')
-rw-r--r--src/backend/access/transam/xlog.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index efaba469cc8..720f18116e9 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6507,20 +6507,12 @@ StartupXLOG(void)
}
/*
- * Initialize shared replayEndRecPtr, lastReplayedEndRecPtr, and
- * recoveryLastXTime.
- *
- * This is slightly confusing if we're starting from an online
- * checkpoint; we've just read and replayed the checkpoint record, but
- * we're going to start replay from its redo pointer, which precedes
- * the location of the checkpoint record itself. So even though the
- * last record we've replayed is indeed ReadRecPtr, we haven't
- * replayed all the preceding records yet. That's OK for the current
- * use of these variables.
+ * Initialize shared variables for tracking progress of WAL replay,
+ * as if we had just replayed the record before the REDO location.
*/
SpinLockAcquire(&xlogctl->info_lck);
- xlogctl->replayEndRecPtr = ReadRecPtr;
- xlogctl->lastReplayedEndRecPtr = EndRecPtr;
+ xlogctl->replayEndRecPtr = checkPoint.redo;
+ xlogctl->lastReplayedEndRecPtr = checkPoint.redo;
xlogctl->recoveryLastXTime = 0;
xlogctl->recoveryPause = false;
SpinLockRelease(&xlogctl->info_lck);