Skip to content

Commit 7742f99

Browse files
committed
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.
1 parent 07961ef commit 7742f99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/transam/xlogwait.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ WaitForLSN(WaitLSNType lsnType, XLogRecPtr targetLSN, int64 timeout)
347347
currentLSN = GetFlushRecPtr(NULL);
348348

349349
/* Check that recovery is still in-progress */
350-
if (!RecoveryInProgress())
350+
if (lsnType == WAIT_LSN_TYPE_REPLAY && !RecoveryInProgress())
351351
{
352352
/*
353353
* Recovery was ended, but check if target LSN was already

0 commit comments

Comments
 (0)