From: Alexander Korotkov Date: Fri, 7 Nov 2025 21:34:50 +0000 (+0200) Subject: Fix checking for recovery state in WaitForLSN() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7742f99a02ed1679eb6baeb35491ea3cf8a3a36e;p=thirdparty%2Fpostgresql.git Fix checking for recovery state in WaitForLSN() We only need to do it for WAIT_LSN_TYPE_REPLAY. WAIT_LSN_TYPE_FLUSH can work for both primary and follower. --- diff --git a/src/backend/access/transam/xlogwait.c b/src/backend/access/transam/xlogwait.c index 6b4c1623e57..34fa41ed9b2 100644 --- a/src/backend/access/transam/xlogwait.c +++ b/src/backend/access/transam/xlogwait.c @@ -347,7 +347,7 @@ WaitForLSN(WaitLSNType lsnType, XLogRecPtr targetLSN, int64 timeout) currentLSN = GetFlushRecPtr(NULL); /* Check that recovery is still in-progress */ - if (!RecoveryInProgress()) + if (lsnType == WAIT_LSN_TYPE_REPLAY && !RecoveryInProgress()) { /* * Recovery was ended, but check if target LSN was already