Separate GUC for replication origins
Euler Taveira <euler@eulerto.com>
From: "Euler Taveira" <euler@eulerto.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2024-12-10T18:41:08Z
Lists: pgsql-hackers
Attachments
- v1-0001-Separate-GUC-for-replication-origins.patch (text/x-patch) patch v1-0001
Hi, We usually use max_replication_slots as the maximum number of replication origins. It predates the logical replication infrastructure (commit 5aa2350426c). However, it is confusing (if it is the first time you are dealing with logical replication. Why do I need to set replication slots on subscriber if the replication slots are stored on publisher?) and it has a limitation (you cannot have a setup where you want to restrict the number of replication slots and have a high number of subscriptions or vice-versa). The initial commit also mentions that it is not adequate (origin.c). /* * XXX: max_replication_slots is arguably the wrong thing to use, as here * we keep the replay state of *remote* transactions. But for now it seems * sufficient to reuse it, rather than introduce a separate GUC. */ and another comment suggests that we should have a separate GUC for it. /* * Base address into a shared memory array of replication states of size * max_replication_slots. * * XXX: Should we use a separate variable to size this rather than * max_replication_slots? */ The commit a8500750ca0 is an attempt to clarify that the max_replication_slots can have different meanings depending on the node role (publisher or subscriber). I'm attaching a patch that adds max_replication_origins. It basically replaces all of the points that refers to max_replication_slots on the subscriber. It uses the same default value as max_replication_slots (10). I did nothing to keep the backward compatibility. I mean has a special value (like -1) that means same value as max_replication_slots. Is it worth it? (If not, it should be mentioned in the commit message.) -- Euler Taveira EDB https://www.enterprisedb.com/
Commits
-
Add GUC option to control maximum active replication origins.
- 04ff636cbce4 18.0 landed
-
Better document logical replication parameters
- a8500750ca0a 16.0 cited
-
Introduce replication progress tracking infrastructure.
- 5aa2350426c4 9.5.0 cited