]> granicus.if.org Git - postgresql/commitdiff
Correctly initialise shared recoveryLastRecPtr in recovery.
authorSimon Riggs <simon@2ndQuadrant.com>
Fri, 13 Jan 2012 13:02:44 +0000 (13:02 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Fri, 13 Jan 2012 13:02:44 +0000 (13:02 +0000)
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

src/backend/access/transam/xlog.c

index 19ef66b5f82fe9860126473a6ee2a70f01560c48..ce659ec63d920bd29755aa393c55c600fe052d71 100644 (file)
@@ -6407,7 +6407,7 @@ StartupXLOG(void)
                 */
                SpinLockAcquire(&xlogctl->info_lck);
                xlogctl->replayEndRecPtr = ReadRecPtr;
-               xlogctl->recoveryLastRecPtr = ReadRecPtr;
+               xlogctl->recoveryLastRecPtr = EndRecPtr;
                xlogctl->recoveryLastXTime = 0;
                xlogctl->currentChunkStartTime = 0;
                xlogctl->recoveryPause = false;