Logical Replication vs. Free Replication Slots

From: Don Seiler <don(at)seiler(dot)us>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Logical Replication vs. Free Replication Slots
Date: 2023-10-03 15:27:01
Message-ID: CAHJZqBAubxad74rQv8LeKe2XTQQTGPjh7ZetKRPPAZWWvUmKrQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Good morning,

I'm trying to set up native logical replication from PG 12.15 (Ubuntu
18.04) to 15.4 (Ubuntu 22.04). I wanted to set up 3 publications to split
up the work. I initially created the three publications with a handful of
tables each. On the source (PG 12.15) instance, we have bumped
max_replication_slots and max_wal_senders to 50, and
max_sync_workers_per_subscription to 10.

When I create the subscriptions to start the initial table sync, the third
one failed to enable, with this error:

2023-09-29 21:07:45.861 UTC [1853362] ERROR: could not find free
replication state slot for replication origin with ID 11 2023-09-29
21:07:45.861 UTC [1853362] HINT: Increase max_replication_slots and try
again. 2023-09-29 21:07:45.861 UTC [1853362] LOG: subscription "sub03" has
been disabled because of an error

However when I look at the publication side, there are only 20 replication
slots created (out of 50 max), 3 of which are the subscriptions and the
rest are the tablesyncs workers.

So I'm trying to make sense of why it would tell me to increase
max_replication_slots when I don't appear to be anywhere near the max.
--
Don Seiler
www.seiler.us

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Don Seiler 2023-10-03 16:41:57 Re: Logical Replication vs. Free Replication Slots
Previous Message Ron 2023-10-03 15:08:17 Re: Problems starting slave