[PATCH] Add max_logical_replication_slots GUC - Mailing list pgsql-hackers

From Ahmed Et-tanany
Subject [PATCH] Add max_logical_replication_slots GUC
Date
Msg-id CAD7nQBCHp5jok49zcr5mbgaRKWpuiimZks2U3zV-W801pYT1JQ@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Add max_logical_replication_slots GUC
List pgsql-hackers
Hello Hackers,

This patch introduces a new postmaster-level configuration parameter,
max_logical_replication_slots, which limits the number of logical
replication slots that can be created.

Currently, max_replication_slots governs the total number of slots,
but there's no separate limit for logical slots. This patch:

Adds max_logical_replication_slots GUC, defaulting to -1
(falls back to max_replication_slots).

Enforces at server startup that max_logical_replication_slots ≤
max_replication_slots. PostgreSQL will refuse to start if this
is violated or if there are more existing logical slots than
the configured maximum.

Checks the logical slot limit when creating new slots at runtime,
preventing creation beyond the configured maximum.

Updates documentation, sample config, and test_decoding tests
to include logical slot limits.

This provides a separation between logical and total replication
slots, and allows users to control logical slot usage independently.

Best regards,

--
Ahmed Et-tanany
Aiven: https://aiven.io/
Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Remove unused argument from ApplyLogicalMappingFile()
Next
From: Álvaro Herrera
Date:
Subject: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY