Correctly initialise shared recoveryLastRecPtr in recovery.

Previously we used ReadRecPtr rather than EndRecPtr, which was
not a serious error but caused pg_stat_replication to report
incorrect replay_location until at least one WAL record is replayed.

Fujii Masao
REL9_1_STABLE
Simon Riggs 14 years ago
parent 6182e01f18
commit 11c730f412
  1. 2
      src/backend/access/transam/xlog.c

@ -6451,7 +6451,7 @@ StartupXLOG(void)
*/
SpinLockAcquire(&xlogctl->info_lck);
xlogctl->replayEndRecPtr = ReadRecPtr;
xlogctl->recoveryLastRecPtr = ReadRecPtr;
xlogctl->recoveryLastRecPtr = EndRecPtr;
xlogctl->recoveryLastXTime = 0;
xlogctl->recoveryPause = false;
SpinLockRelease(&xlogctl->info_lck);

Loading…
Cancel
Save