Re: Implement waiting for wal lsn replay: reloaded - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Implement waiting for wal lsn replay: reloaded
Date
Msg-id 2eg4msihe4kbmwmxyoamgeeg5xj4fr2tlfj2omss3d3to2kveg@lbhhfggrdrw4
Whole thread
In response to Re: Implement waiting for wal lsn replay: reloaded  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: Implement waiting for wal lsn replay: reloaded
List pgsql-hackers
Hi,

On 2026-04-08 02:30:44 +0300, Alexander Korotkov wrote:
> On Tue, Apr 7, 2026 at 6:55 PM Xuneng Zhou <xunengzhou@gmail.com> wrote:
> 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.

That's sufficient for the first iteration, but what guarantees it once you do
WaitLatch()?  That's likely going to imply a barrier somewhere in the kernel,
but I don't think there's any actual guarantee.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Automatically sizing the IO worker pool
Next
From: Chao Li
Date:
Subject: Re: Add errdetail() with PID and UID about source of termination signal