Re: Incorrect logic in XLogNeedsFlush()
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Melanie Plageman <melanieplageman@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Andres Freund <andres@anarazel.de>
Date: 2025-09-10T23:21:21Z
Lists: pgsql-hackers
On Wed, Sep 10, 2025 at 09:58:08AM -0700, Jeff Davis wrote: > It seems like XLogFlush() and XLogNeedsFlush() should use the same > test, otherwise you could always get some confusing inconsistency. > Right? Even if the checks are duplicated (dependency could be documented as well), it would make sense to me to plant a check of XLogNeedsFlush() inside XLogFlush(), I think. I have not tried if some parts of the tests blow up when trying to do that even after switching XLogNeedsFlush() to check if WAL inserts are allowed rather than if we are in recovery. -- Michael
Commits
-
Reorder XLogNeedsFlush() checks to be more consistent
- bb68cde4136b 19 (unreleased) landed
-
Make XLogFlush() and XLogNeedsFlush() decision-making more consistent
- deb208df4559 19 (unreleased) landed