Re: Incorrect logic in XLogNeedsFlush()

Melanie Plageman <melanieplageman@gmail.com>

From: Melanie Plageman <melanieplageman@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
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-22T12:09:18Z
Lists: pgsql-hackers
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.

- Melanie



Commits

  1. Reorder XLogNeedsFlush() checks to be more consistent

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