From 11c730f4122ee8677b1cfdd5647faeaabc471af8 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Wed, 22 Feb 2012 13:53:48 +0000 Subject: [PATCH] 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 --- src/backend/access/transam/xlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.40.0