Re: Adding a '--two-phase' option to 'pg_createsubscriber' utility. - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Adding a '--two-phase' option to 'pg_createsubscriber' utility.
Date
Msg-id CAA4eK1JZC7oknTe2OWq6Kw4+h-_UEQN5JckUWuL7aHg-PJD-JA@mail.gmail.com
Whole thread Raw
In response to Re: Adding a '--two-phase' option to 'pg_createsubscriber' utility.  (vignesh C <vignesh21@gmail.com>)
Responses Re: Adding a '--two-phase' option to 'pg_createsubscriber' utility.
List pgsql-hackers
On Tue, Feb 18, 2025 at 12:16 AM Shubham Khanna
<khannashubham1197@gmail.com> wrote:
>

-static void check_publisher(const struct LogicalRepInfo *dbinfo);
-static char *setup_publisher(struct LogicalRepInfo *dbinfo);
+static void check_publisher(const struct LogicalRepInfo *dbinfo, bool
two_phase);
+static char *setup_publisher(struct LogicalRepInfo *dbinfo, bool two_phase);
 static void check_subscriber(const struct LogicalRepInfo *dbinfo);
 static void setup_subscriber(struct LogicalRepInfo *dbinfo,
- const char *consistent_lsn);
+ const char *consistent_lsn, bool two_phase);
 static void setup_recovery(const struct LogicalRepInfo *dbinfo, const
char *datadir,
     const char *lsn);
 static void drop_primary_replication_slot(struct LogicalRepInfo *dbinfo,
    const char *slotname);
 static void drop_failover_replication_slots(struct LogicalRepInfo *dbinfo);
 static char *create_logical_replication_slot(PGconn *conn,
- struct LogicalRepInfo *dbinfo);
+ struct LogicalRepInfo *dbinfo,
+ bool two_phase);
 static void drop_replication_slot(PGconn *conn, struct LogicalRepInfo *dbinfo,
    const char *slot_name);
 static void pg_ctl_status(const char *pg_ctl_cmd, int rc);
@@ -98,7 +100,9 @@ static void wait_for_end_recovery(const char *conninfo,
    const struct CreateSubscriberOptions *opt);
 static void create_publication(PGconn *conn, struct LogicalRepInfo *dbinfo);
 static void drop_publication(PGconn *conn, struct LogicalRepInfo *dbinfo);
-static void create_subscription(PGconn *conn, const struct
LogicalRepInfo *dbinfo);
+static void create_subscription(PGconn *conn,
+ const struct LogicalRepInfo *dbinfo,
+ bool two_phase);

Specifying two_phase as a separate parameter in so many APIs looks
odd. Wouldn't it be better to make it part of LogicalRepInfo as we do
with other parameters of CreateSubscriberOptions?

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql \dh: List High-Level (Root) Tables and Indexes
Next
From: Evgeny
Date:
Subject: Re: Elimination of the repetitive code at the SLRU bootstrap functions.