Re: Documentation to upgrade logical replication cluster

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Subject: Re: Documentation to upgrade logical replication cluster
Date: 2024-09-24 10:50:10
Message-ID: CAA4eK1+buBTu7TeUZK8j_LOk1nnvi0EKA6p+4puJZxDq77=qTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 20, 2024 at 5:46 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> I didn’t include a note because each disable/enable statement
> specifies: a) Disable all subscriptions on the node, b) Enable all
> subscriptions on the node. The attached v11 version patch just to show
> the examples with one subscription.
>

The following steps in the bi-directional node upgrade have some problems.

+ <para>
+ On <literal>node1</literal>, create any tables that were created in
+ <literal>node2</literal> between <xref
linkend="circular-cluster-disable-sub-node2"/>
+ and now, e.g.:
+<programlisting>
+node1=# CREATE TABLE distributors (did integer PRIMARY KEY, name varchar(40));
+CREATE TABLE
+</programlisting>
+ </para>
+ </step>
+
+ <step>
+ <para>
+ Enable all the subscriptions on <literal>node2</literal> that are
+ subscribing the changes from <literal>node1</literal> by using
+ <link linkend="sql-altersubscription-params-enable"><command>ALTER
SUBSCRIPTION ... ENABLE</command></link>,
+ e.g.:
+<programlisting>
+node2=# ALTER SUBSCRIPTION sub1_node1_node2 ENABLE;
+ALTER SUBSCRIPTION
+</programlisting>
+ </para>
+ </step>
+
+ <step>
+ <para>
+ Refresh the <literal>node2</literal> subscription's publications using
+ <link linkend="sql-altersubscription-params-refresh-publication"><command>ALTER
SUBSCRIPTION ... REFRESH PUBLICATION</command></link>,
+ e.g.:
+<programlisting>
+node2=# ALTER SUBSCRIPTION sub1_node1_node2 REFRESH PUBLICATION;
+ALTER SUBSCRIPTION
+</programlisting>
+ </para>

If you are creating missing tables on node-1, won't that node's
subscription be refreshed to get the missing data? Also, I suggest
moving the step-2 in the above steps to enable subscriptions on node-2
should be moved before creating a table on node-1 and then issuing a
REFRESH command on node-1. The similar steps for other node's upgrade
following these steps have similar problems.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2024-09-24 10:51:54 Re: not null constraints, again
Previous Message Tatsuo Ishii 2024-09-24 10:00:04 Re: pgbench: Improve result outputs related to failed transactinos