Re: VM corruption on standby - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: VM corruption on standby
Date
Msg-id 28F7B243-A008-4C74-B22A-367A33DFBF01@yandex-team.ru
Whole thread Raw
In response to Re: VM corruption on standby  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-hackers

> On 10 Sep 2025, at 15:25, Alexander Korotkov <aekorotkov@gmail.com> wrote:
>
> I think the approach #2 is more appropriate for bc22dc0e0d, because in
> the critical section we only wait for other processes also in the
> critical section (so, there is no risk they will exit immediately
> after postmaster death making us stuck).  I've implemented a patch,
> where waiting on conditional variable is replaced with LWLock-style
> waiting on semaphore.  However, custom waiting code just for
> AdvanceXLInsertBuffer() doesn't look good.

Well, at least I'd like to see corruption-free solution for injection point wait too.

>  I believe we need some
> general solution.  We might have a special kind of condition variable,
> a critical section condition variable, where both waiting and
> signaling must be invoked only in a critical section.  However, I dig
> into our Latch and WaitEventSet, it seems there are too many
> assumptions about postmaster death.  So, a critical section condition
> variable probably should be implemented on top of semaphore.  Any
> thoughts?

We want Latch\WaitEventSet, but for critical section. Is it easier to implement from scratch (from semaphores), or is
iteasier to fix and maintain existing Latch\WaitEventSet? 


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: GB18030-2022 Support in PostgreSQL
Next
From: Dilip Kumar
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication