]> granicus.if.org Git - postgresql/commitdiff
Correctly initialise shared recoveryLastRecPtr in recovery.
authorSimon Riggs <simon@2ndQuadrant.com>
Wed, 22 Feb 2012 13:55:04 +0000 (13:55 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Wed, 22 Feb 2012 13:55:04 +0000 (13:55 +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 936c2bf24adb2b1f590bd01f85d9e85bbd3ea088..85cb2accc32f1cf31cea0910823292fa23f53b56 100644 (file)
@@ -6134,7 +6134,7 @@ StartupXLOG(void)
                 */
                SpinLockAcquire(&xlogctl->info_lck);
                xlogctl->replayEndRecPtr = ReadRecPtr;
-               xlogctl->recoveryLastRecPtr = ReadRecPtr;
+               xlogctl->recoveryLastRecPtr = EndRecPtr;
                xlogctl->recoveryLastXTime = 0;
                SpinLockRelease(&xlogctl->info_lck);