Re: Incorrect logic in XLogNeedsFlush()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Melanie Plageman <melanieplageman@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>, Jeff Davis <pgsql@j-davis.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Andres Freund <andres@anarazel.de>
Date: 2025-09-23T23:25:34Z
Lists: pgsql-hackers
On Mon, Sep 22, 2025 at 08:09:18AM -0400, Melanie Plageman wrote:
> On Fri, Sep 19, 2025 at 1:28 AM Michael Paquier <michael@paquier.xyz> wrote:
>> Do we want to make the order of the checks to be more consistent in
>> both routines?  These would require a separate set of double-checks
>> and review, but while we're looking at this area of the code we may as
>> tweak it more..
> 
> That makes sense to me to avoid future questions such as mine.

Would somebody like to propose a patch?  Doing so on this thread would
be OK for me, but perhaps it would be better to discuss that on a new
one as we would deal with a separate problem.
--
Michael

Commits

  1. Reorder XLogNeedsFlush() checks to be more consistent

  2. Make XLogFlush() and XLogNeedsFlush() decision-making more consistent