| From: | Xuneng Zhou <xunengzhou(at)gmail(dot)com> |
|---|---|
| To: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
| Cc: | Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, jian he <jian(dot)universality(at)gmail(dot)com>, Tomas Vondra <tomas(at)vondra(dot)me>, Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru> |
| Subject: | Re: Implement waiting for wal lsn replay: reloaded |
| Date: | 2026-04-08 00:20:04 |
| Message-ID: | CABPTF7WC0DdMkQz1NWymS3rRSn_p09yFjM36z0CtmW3+WY0mcA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Apr 8, 2026 at 7:30 AM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
>
> On Tue, Apr 7, 2026 at 6:55 PM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
> >
> > On Tue, Apr 7, 2026 at 9:46 PM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> > >
> > > On Tue, Apr 7, 2026, 16:18 Andres Freund <andres(at)anarazel(dot)de> wrote:
> > >>
> > >> Hi,
> > >>
> > >> On 2026-04-07 21:05:40 +0800, Xuneng Zhou wrote:
> > >> > I’ve posted two patches. The first fixes the duplication issue
> > >> > reported by Andres and is fairly straightforward. The second turned
> > >> > out to be more complex than expected, and I’m still working through
> > >> > possible solutions. Feedback or alternative approaches would be very
> > >> > helpful.
> > >> > I also spent some time drafting a patch to address the memory ordering
> > >> > issue and will post it later.
> > >>
> > >> I propose quickly applying a minimal patch like the attached, to get the test
> > >> performance back to normal.
> > >>
> > >> Will do so unless somebody protests within in one CI cycle and one coffee.
> > >
> > >
> > > I would be able to review them only after several hours. But +1 for applying now to get rid of buildfarm slowdown.
> >
> > Here is a patch addressing the memory order issue reported earlier.
>
> I agree to change in WaitLSNWakeup(), memory barrier looks necessary there.
> Regarding GetCurrentLSNForWaitType(), I don't think barrier is needed
> here, nor think it makes things clearer. I think it would be enough
> to comment that LWLock operations in addLSNWaiter()/deleteLSNWaiter()
> provide necessary barriers.
>
I’m fine with that if Andres has no objection. That said, callers of
WaitLSNWakeup except STANDBY_WRITE do acquire locks before the wakeup.
I’m not sure whether a memory barrier is required for all of them,
though placing the barrier inside WaitLSNWakeup would make the
handling less scattered.
--
Best,
Xuneng
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andres Freund | 2026-04-08 00:30:44 | Re: Automatically sizing the IO worker pool |
| Previous Message | Michael Paquier | 2026-04-08 00:07:50 | Re: test_autovacuum/001_parallel_autovacuum is broken |