From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Drop replication origin slots before tablesync worker exits.
Date: Tue, 30 Aug 2022 03:32:59 +0000
Message-ID: <E1oSrzn-000YIp-4s@gemulon.postgresql.org> (raw)
Drop replication origin slots before tablesync worker exits.
Currently, the replication origin tracking of the tablesync worker is
dropped by the apply worker. So, there will be a small lag between the
tablesync worker exit and its origin tracking got removed. In the
meantime, new tablesync workers can be launched and will try to set up
a new origin tracking. This can lead the system to reach max configured
limit (max_replication_slots) even if the user has configured the max
limit considering the number of tablesync workers required in the system.
We decided not to back-patch as this can occur in very narrow
circumstances and users have to option to increase the configured limit by
increasing max_replication_slots.
Reported-by: Hubert Depesz Lubaczewski
Author: Ajin Cherian
Reviwed-by: Masahiko Sawada, Peter Smith, Hou Zhijie, Amit Kapila
Discussion: https://postgr.es/m/20220714115155.GA5439@depesz.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f6c5edb8abcac04eb3eac6da356e59d399b2bcef
Modified Files
--------------
src/backend/commands/subscriptioncmds.c | 25 ++++++++-------
src/backend/replication/logical/tablesync.c | 50 ++++++++++++++++-------------
2 files changed, 41 insertions(+), 34 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: akapila@postgresql.org
Subject: Re: pgsql: Drop replication origin slots before tablesync worker exits.
In-Reply-To: <E1oSrzn-000YIp-4s@gemulon.postgresql.org>
References: <E1oSrzn-000YIp-4s@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox