[Patch] add new parameter to pg_replication_origin_session_setup
Doruk Yilmaz <doruk@mixrank.com>
From: Doruk Yilmaz <doruk@mixrank.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2024-08-12T18:43:48Z
Lists: pgsql-hackers
Attachments
- 0001-pg_replication_origin_session_setup-new-parameter.patch (text/x-patch) patch 0001
Hello all,
While working on our internal tools that utilise replication, we
realised that a new parameter was added to the internal C function
corresponding to pg_replication_origin_session_setup.
However this parameter wasn't included in the user-facing API [1].
In 'src/backend/replication/logical/origin.c' at line 1359,
pg_replication_origin_session_setup function calls
replorigin_session_setup(origin, 0);
where currently 0 is assigned to the acquired_by parameter of the
replorigin_session_setup.
I made this patch to the master which adds a way to control this
parameter by adding a new version of the
pg_replication_origin_session_setup function with user facing
parameters 'text int4' in place of the current 'text' while keeping
the existing variant
(ensuring backwards compatibility). Could someone take a look at it?
[1]: https://www.postgresql.org/docs/current/functions-admin.html#PG-REPLICATION-ORIGIN-SESSION-SETUP
---
Thanks for the help,
Doruk Yılmaz
Commits
-
Refactor replorigin_session_setup() for better readability.
- 735e8fe68535 19 (unreleased) landed
-
Prevent unintended dropping of active replication origins.
- e385a4e2fd8e 19 (unreleased) landed
-
Add optional pid parameter to pg_replication_origin_session_setup().
- 5b148706c5c8 19 (unreleased) landed