Re: Incorrect logic in XLogNeedsFlush() - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: Incorrect logic in XLogNeedsFlush()
Date
Msg-id CAFiTN-swRpG9x+h4oRwCMb+3AKhNOoWT0JUjbBO-k_b2eE0KpA@mail.gmail.com
Whole thread Raw
In response to Re: Incorrect logic in XLogNeedsFlush()  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Fri, Sep 19, 2025 at 10:58 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Thu, Sep 18, 2025 at 05:07:00PM +0530, Dilip Kumar wrote:
> > I think this comment is a side note which is stating that it is
> > possible that while XLogNeedFlush() is deciding that based on the
> > current flush position or min recovery point parallely someone might
> > flush beyond that point.  And it was existing comment which has been
> > improved by adding min recovery points, so I think it makes sense.
>
> Indeed.  I have kept this one after drinking more caffeine, rewording
> it slightly.
>
> > I tried improving this comment as well. Feel free to disregard it if
> > you think it's not improving it.
>
> The new additions in XLogNeedsFlush() felt overweight, though, so I
> have kept a shorter and reworded version.  Then, applied the result.

Thanks.

> 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..

I see both routines have the same order i.e. first check if
(!XLogInsertAllowed()) and then if (record <= LogwrtResult.Flush),
what am I missing?

--
Regards,
Dilip Kumar
Google



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: "openssl" should not be optional
Next
From: Ashutosh Bapat
Date:
Subject: Re: Report bytes and transactions actually sent downtream