summaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2025-11-07 23:34:50 +0200
committerAlexander Korotkov <akorotkov@postgresql.org>2025-11-07 23:34:50 +0200
commit7742f99a02ed1679eb6baeb35491ea3cf8a3a36e (patch)
tree86da884eaa3ff128a7853e30fd060279b20b77f8 /src/backend/access
parent07961ef86625be91e243f1dff8911cb1d70e443f (diff)
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.
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/transam/xlogwait.c2
1 files changed, 1 insertions, 1 deletions
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