Release synchronous replication waiters immediately on configuration changes.
Previously, when synchronous_standby_names was changed (for example, by reducing the number of required synchronous standbys or modifying the standby list), backends waiting for synchronous replication were not released immediately, even if the new configuration no longer required them to wait. They could remain blocked until additional messages arrived from standbys and triggered their release. This commit improves walsender so that backends waiting for synchronous replication are released as soon as the updated configuration takes effect and the new settings no longer require them to wait, by calling SyncRepReleaseWaiters() when configuration changes are processed. As part of this change, the duplicated code that handles configuration changes in walsender has been refactored into a new helper function, which is now used at the three existing call places. Since this is an improvement rather than a bug fix, it is applied only to the master branch. Author: Shinya Kato <[email protected]> Reviewed-by: Chao Li <[email protected]> Reviewed-by: Fujii Masao <[email protected]> Reviewed-by: Xuneng Zhou <[email protected]> Discussion: https://postgr.es/m/CAOzEurSRii0tEYhu5cePmRcvS=zrxtlevxm3kj0d7_ukgdm...@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/21c1125d660617f71b20304150e4a8583299cf86 Modified Files -------------- src/backend/replication/walsender.c | 47 +++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 18 deletions(-)
