]> granicus.if.org Git - postgresql/commitdiff
Correctly initialise shared recoveryLastRecPtr in recovery.
authorSimon Riggs <simon@2ndQuadrant.com>
Wed, 22 Feb 2012 13:53:48 +0000 (13:53 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Wed, 22 Feb 2012 13:53:48 +0000 (13:53 +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 1ec5b51554aa1a18e24ea1c2fce67d712b46c4f7..49cccaed9c70184aa15d9d580ef7ae421bfdbdb4 100644 (file)
@@ -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);