Re: Wake up backends immediately when sync standbys decrease - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Wake up backends immediately when sync standbys decrease
Date
Msg-id CAHGQGwHmusDZLmJ8H=+200Y9Wy-Kg3+_oO0wD_y_T_2EmxkZnQ@mail.gmail.com
Whole thread Raw
In response to Re: Wake up backends immediately when sync standbys decrease  (Chao Li <li.evan.chao@gmail.com>)
List pgsql-hackers
On Fri, Jan 30, 2026 at 4:49 PM Chao Li <li.evan.chao@gmail.com> wrote:
>
>
>
> > On Jan 30, 2026, at 14:59, Shinya Kato <shinya11.kato@gmail.com> wrote:
> >
> > Hi hackers,
> >
> > I have noticed an issue where backends waiting for synchronous
> > replication are not woken up immediately when the number of required
> > synchronous standbys is reduced in a multiple synchronous standby
> > environment.

Thanks for reporting this!

This issue can occur not only when the number of sync standbys is reduced,
but also when the configured standby names change. For example, if the config
changes from "FIRST 2 (sby1, sby2)" to "FIRST 2 (sby1, sby3)",
waiters on sby2 should be released immediately. But, currently, there can
a delay before that happens. Right?


> My main concern is code duplication. The same block is added in three places. While the existing reload handling is
alreadyduplicated there, adding more logic on top makes the situation a bit worse from a maintenance perspective. 
>
> Would it make sense to factor the reload handling into a small helper, for example:

+1

Regards,


--
Fujii Masao



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Flush some statistics within running transactions
Next
From: "zengman"
Date:
Subject: Re: implement CAST(expr AS type FORMAT 'template')