Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.

From: Shubham Khanna <khannashubham1197(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Smith <smithpb2250(at)gmail(dot)com>
Subject: Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Date: 2025-03-10 06:30:50
Message-ID: CAHv8RjLCZyzFMGR8SBdvSocRZGAAr_eRd4ht48kXCp9oEaKQeQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 5, 2025 at 3:55 PM Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
>
> On Tue, Mar 4, 2025 at 8:05 PM Shubham Khanna
> <khannashubham1197(at)gmail(dot)com> wrote:
> >
> > The attached Patch contains the suggested changes.
> >
>
> Hi Shubham,
>
> Here are few comments for 040_pg_createsubscriber.pl
>
> 1)
> +# Run pg_createsubscriber on node S using '--cleanup-existing-publications'.
> +# --verbose is used twice to show more information.
>
> 1a) /node S/ node S1
>
> 1b) Also, can we keep the comment in the same pattern as it was earlier -
> # Run pg_createsubscriber on node S1. --verbose is used twice
> # to show more information.
> # In passing, also test the --enable-two-phase and
> --cleanup-existing-publications
> # options.
>

Fixed.

> 2)
> +# Reuse P as primary
> +# Set up node S2 as standby linking to node P
> +$node_p->backup('backup_3');
>
> /Reuse P as/ Reuse node P as/
>

Fixed.

> 3)
> +$node_s2->append_conf(
> + 'postgresql.conf', qq[
> + primary_conninfo = '$pconnstr'
> + hot_standby_feedback = on
> + max_logical_replication_workers = 5
> + ]);
>
> Do we need "hot_standby_feedback = on" on node_s2? I think we can remove it.
>

Removed and updated the configurations.

> 4)
> +# Create user-defined publications
> +$node_p->safe_psql($db3, "CREATE PUBLICATION test_pub3 FOR ALL TABLES;");
> +$node_p->safe_psql($db3, "CREATE PUBLICATION test_pub4 FOR ALL TABLES;");
>
> Can create both publications under one safe_psql as -
>
> $node_p->safe_psql($db3, qq[CREATE PUBLICATION test_pub3 FOR ALL TABLES;
> CREATE PUBLICATION test_pub4 FOR ALL TABLES;
> ]);
>

Fixed.

> 5)
> +# Run pg_createsubscriber on node A without using
> +# '--cleanup-existing-publications'.
> +# --verbose is used twice to show more information.
>
> 5a) /node A/node S2/
> 5b) /without using '--cleanup-existing-publications' / without
> '--cleanup-existing-publications' option
>

Fixed.

> 6)
> + ],
> + 'run pg_createsubscriber without --cleanup-existing-publications on node A'
> +);
>
> /node A/node S2/
>

Fixed.

> 7)
> +# Drop the newly created publications
> +$node_p->safe_psql($db3, "DROP PUBLICATION IF EXISTS test_pub3;");
> +$node_p->safe_psql($db3, "DROP PUBLICATION IF EXISTS test_pub4;");
>
> Similar to #4, use single safe_psql to drop both the publications.
> OTOH, do we really need to drop the publications here? I think we can
> remove this part since we're performing cleanup right after.
> ~~~~
>
> --

Fixed.

The attached patch contains the suggested changes.

Thanks and regards,
Shubham Khanna.

Attachment Content-Type Size
v14-0001-Support-for-dropping-all-publications-in-pg_crea.patch application/octet-stream 23.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shubham Khanna 2025-03-10 06:41:06 Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Previous Message Amit Kapila 2025-03-10 06:28:38 Re: Parallel heap vacuum