Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 397cd0b

Browse files
author
Amit Kapila
committed
Remove redundant fetch of the recent flush pointer in WalSndWaitForWal.
In WalSndWaitForWal(), we fetch a recent flush pointer both outside the loop and inside the loop. But we start using RecentFlushPtr only after we fetch it inside the loop. So we can remove one outside the loop. Author: Shveta Malik Reviewed-by: Bertrand Drouvot, Matthias van de Meent, Amit Kapila Discussion: https://postgr.es/m/CAJpy0uBSCQz1yMD-WiEthzEe23dti2-Kr_pitVb7vAPFbFKm=A@mail.gmail.com
1 parent 2c8118e commit 397cd0b

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/backend/replication/walsender.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,12 +1831,6 @@ WalSndWaitForWal(XLogRecPtr loc)
18311831
!NeedToWaitForWal(loc, RecentFlushPtr, &wait_event))
18321832
return RecentFlushPtr;
18331833

1834-
/* Get a more recent flush pointer. */
1835-
if (!RecoveryInProgress())
1836-
RecentFlushPtr = GetFlushRecPtr(NULL);
1837-
else
1838-
RecentFlushPtr = GetXLogReplayRecPtr(NULL);
1839-
18401834
/*
18411835
* Within the loop, we wait for the necessary WALs to be flushed to disk
18421836
* first, followed by waiting for standbys to catch up if there are enough

0 commit comments

Comments
 (0)