summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2012-02-22 13:53:48 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2012-02-22 13:53:48 +0000
commit11c730f4122ee8677b1cfdd5647faeaabc471af8 (patch)
tree363c1717790500e44863d04b6ab60168afcb4f08
parent6182e01f18f71c48915e2aebb20362294de6e677 (diff)
downloadpostgresql-11c730f4122ee8677b1cfdd5647faeaabc471af8.tar.gz
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
-rw-r--r--src/backend/access/transam/xlog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 1ec5b51554..49cccaed9c 100644
--- a/src/backend/access/transam/xlog.c
+++ b/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);