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.