Re: Small fixes needed by high-availability tools - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Small fixes needed by high-availability tools
Date
Msg-id CAA4eK1JE0XDmn91H=AHrfPXghSJFK_NGY+P8HqCtvWN7nOwAsg@mail.gmail.com
Whole thread Raw
In response to Re: Small fixes needed by high-availability tools  (Mihail Nikalayeu <mihailnikalayeu@gmail.com>)
List pgsql-hackers
On Wed, May 14, 2025 at 2:15 AM Mihail Nikalayeu
<mihailnikalayeu@gmail.com> wrote:
>
> > One idea to solve this problem could be that whenever we cancel
> > sync_rep_wait, we set some system-wide flag that indicates that any
> > new transaction must ensure that all the current data is replicated to
> > the synchronous standby. Once we ensure that we have waited for
> > pending transactions to replicate, we can toggle back that system-wide
> > flag. Now, if the system restarts for any reason during such a wait,
> > we can use your idea to disallow new connections until the standby
> > quorum is established.
>
> It might not necessarily be a flag—it could be some LSN value instead.
> Also, it's not just about a "new transaction," but about any new
> snapshot that could see data not yet replicated to the synchronous
> standby.
>

Sounds reasonable to me. Let us see what others think about it.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: Backward movement of confirmed_flush resulting in data duplication.
Next
From: "Jafri, Nazneen"
Date:
Subject: PostgreSQL 18 Beta 1 io_max_concurrency