Commit 5530623d authored by Simon Riggs's avatar Simon Riggs

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
parent 3f1787c2
...@@ -6407,7 +6407,7 @@ StartupXLOG(void) ...@@ -6407,7 +6407,7 @@ StartupXLOG(void)
*/ */
SpinLockAcquire(&xlogctl->info_lck); SpinLockAcquire(&xlogctl->info_lck);
xlogctl->replayEndRecPtr = ReadRecPtr; xlogctl->replayEndRecPtr = ReadRecPtr;
xlogctl->recoveryLastRecPtr = ReadRecPtr; xlogctl->recoveryLastRecPtr = EndRecPtr;
xlogctl->recoveryLastXTime = 0; xlogctl->recoveryLastXTime = 0;
xlogctl->currentChunkStartTime = 0; xlogctl->currentChunkStartTime = 0;
xlogctl->recoveryPause = false; xlogctl->recoveryPause = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment