Regardign RecentFlushPtr in WalSndWaitForWal()
shveta malik <shveta.malik@gmail.com>
From: shveta malik <shveta.malik@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>,
Amit Kapila <amit.kapila16@gmail.com>, shveta malik <shveta.malik@gmail.com>
Date: 2024-02-26T11:46:39Z
Lists: pgsql-hackers
Hi hackers,
I would like to understand why we have code [1] that retrieves
RecentFlushPtr in WalSndWaitForWal() outside of the loop. We utilize
RecentFlushPtr later within the loop, but prior to that, we already
have [2]. Wouldn't [2] alone be sufficient?
Just to check the impact, I ran 'make check-world' after removing [1],
and did not see any issue exposed by the test at-least.
Any thoughts?
[1]:
/* Get a more recent flush pointer. */
if (!RecoveryInProgress())
RecentFlushPtr = GetFlushRecPtr(NULL);
else
RecentFlushPtr = GetXLogReplayRecPtr(NULL);
[2]:
/* Update our idea of the currently flushed position. */
else if (!RecoveryInProgress())
RecentFlushPtr = GetFlushRecPtr(NULL);
else
RecentFlushPtr = GetXLogReplayRecPtr(NULL);
thanks
Shveta
Commits
-
Remove redundant fetch of the recent flush pointer in WalSndWaitForWal.
- 397cd0b3c7d1 17.0 landed
-
Allow logical decoding via the walsender interface.
- 5a991ef8692e 9.4.0 cited