Re: Documentation to upgrade logical replication cluster - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Documentation to upgrade logical replication cluster
Date
Msg-id CAA4eK1+buBTu7TeUZK8j_LOk1nnvi0EKA6p+4puJZxDq77=qTA@mail.gmail.com
Whole thread Raw
In response to Documentation to upgrade logical replication cluster  (vignesh C <vignesh21@gmail.com>)
Responses Re: Documentation to upgrade logical replication cluster
List pgsql-hackers
On Fri, Sep 20, 2024 at 5:46 PM vignesh C <vignesh21@gmail.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.



pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: pgbench: Improve result outputs related to failed transactinos
Next
From: Alvaro Herrera
Date:
Subject: Re: not null constraints, again