Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting
Date: 2025-11-19 03:44:05
Message-ID: CABPTF7VbcpMc2Ge4szQ+RZNNk+46BQe4dVi3vZfr7j4W9OV=uQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Michael,

On Sat, Nov 8, 2025 at 7:03 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Fri, Nov 07, 2025 at 09:48:23PM +0800, Xuneng Zhou wrote:
> > Now that the LSN-waiting infrastructure (3b4e53a) and WAL replay
> > wake-up calls (447aae1) are in place, this patch has been updated to
> > make use of them.
> > Please check.
>
> That's indeed much simpler. I'll check later what you have here.
> --
> Michael

Thanks again for your earlier suggestion on splitting the patches to
make the review process smoother.

Although this version is simpler in terms of the amount of code, the
review effort still feels non-trivial. During my own self-review, a
few points stood out as areas that merit careful consideration:

1) Reliance on the new wait-for-LSN infrastructure

The stability and correctness of this patch now depend heavily on the
newly added wait-for-LSN infrastructure, which has not yet been
battle-tested. This puts the patch in a bit of a dilemma: we want the
infrastructure to be as reliable as possible, but it could be hard to
fully validate its robustness without using it in real scenarios, even
after careful review.

2) Wake-up behavior

Are the waiting processes waking up at the correct points and under
the right conditions? Ensuring proper wake-ups is essential for both
correctness and performance.

3) Edge cases

Are edge cases—such as a promotion occurring while a process is
waiting in standby—handled correctly and without introducing races or
inconsistent states?

--
Best,
Xuneng

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2025-11-19 04:14:03 Re: Row pattern recognition
Previous Message torikoshia 2025-11-19 03:43:22 Re: RFC: Logging plan of the running query