pgsql: Release synchronous replication waiters immediately on configura - Mailing list pgsql-committers

From Fujii Masao
Subject pgsql: Release synchronous replication waiters immediately on configura
Date
Msg-id E1vn5wW-000pF5-0P@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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 <shinya11.kato@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/CAOzEurSRii0tEYhu5cePmRcvS=ZrxTLEvxm3Kj0d7_uKGdM23g@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(-)


pgsql-committers by date:

Previous
From: Fujii Masao
Date:
Subject: pgsql: psql: Add %i prompt escape to indicate hot standby status.
Next
From: Michael Paquier
Date:
Subject: pgsql: Fix incorrect errno in OpenWalSummaryFile()