Thread: Logical Replication vs. Free Replication Slots

Logical Replication vs. Free Replication Slots

From
Don Seiler
Date:
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

Re: Logical Replication vs. Free Replication Slots

From
Don Seiler
Date:
On Tue, Oct 3, 2023 at 10:27 AM Don Seiler <don@seiler.us> wrote:
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.

Forgot to note that on the subscriber (PG 15.4) instance, max_sync_workers_per_subscription is 4, and max_logical_replication_workers is 20. Per the docs, max_sync_workers_per_subscription would have no effect on the publisher side.

Don.
--
Don Seiler
www.seiler.us